csleh
Forum Replies Created
-
Forum: Plugins
In reply to: [TAO Schedule Update] use advanced custom fields?thank you, that does indeed work! and I feel silly for not trying it.
Forum: Fixing WordPress
In reply to: how to troubleshoot missing sectionnevermind. it was a css issue although I don’t know how or why and it’s fixed now.
Forum: Fixing WordPress
In reply to: how to troubleshoot missing sectionmy own custom theme. started with underscores, added some custom post types.
Same issue, pressing save fixed (whew!). Here is the code I used:
<?php $terms = get_terms('members-cats', 'orderby=count&hide_empty=0&parent=0'); if ( !empty( $terms ) && !is_wp_error( $terms ) ){ foreach ( $terms as $term ) { $term = sanitize_term( $term, 'members-cats' ); $term_link = get_term_link( $term, 'members-cats' ); echo '<h3><a href="' . esc_url( $term_link ) . '">' . $term->name . '</a></h3>'; } } ?>
Forum: Hacks
In reply to: counter trickery – adding an extra bit from outside the loop but in sequencethat works perfectly, thank you!
Forum: Hacks
In reply to: counter trickery – adding an extra bit from outside the loop but in sequenceBoth of these solutions
<article class="th<?php echo $counter++; ?>">
<article class="th<?php echo $counter; ?>">
result in a number 0. I’m looking for 1, 2 or 3.Yes, always just one article, always the same one (it’s pulling from a custom field on a different page). It can be either before the first loop or after the last, whichever is easiest.
ah, I took out a line when stripping out extraneous, that’s why the end bracket seemss wrong. This is the actual code
<?php $counter = 0; ?> <?php if(have_posts()) : while(have_posts()) : the_post(); if (($post->post_parent) ) { continue; } else { ?> <?php $counter++; ?> <article class="th<?php echo $counter; ?> m1"> <?php // reset counter if 3 has been reached if ($counter==3){ $counter=0; } ?> <!-- stuff with posts happens here--> </article> <?php } endwhile; endif; ?> <article class="th<?php echo $counter; ?> m1"> <!-- other stuff with this special post from elsewhere--> </article>
Forum: Hacks
In reply to: have 2 category pages – 1 with sub-category listing, 1 with all poststhanks. What I’ve got now is a list of all categories as a link and lower on the page is the start of showing all posts alphabetically, with “previous” to load more posts. It works, but I was hoping to give the visitor an option, like “here is the list of categories but if you click here you can see all posts listed alphabetically instead”. It seems to require making a “page” or “post” so I can get a url to link to because this page is either/or since they are 2 approaches to the same archive/category template.
This is the current:
Fruit Categories - apples - oranges Or view all Posts in Fruit - jonagold - navel - red delicious - tangerine - etc for hundreds of posts
Goal:
Fruit Categories - apples - oranges or click to view a list of all posts in fruit
Forum: Hacks
In reply to: have 2 category pages – 1 with sub-category listing, 1 with all poststhanks for answering. It’s a custom theme with plenty of custom templates, I thought maybe there was an easy way to give visitors an option to view posts by category OR to view all posts alphabetically and I got stuck exactly on a link to what like you mention.
I guess the only option is to create an empty post and have an if statement like “if is this post, show a list of all posts in this category alphabetically”.
It works! Not sure what it was but thanks for trying to help so quickly.
Forum: Fixing WordPress
In reply to: wp_list_pages works but adding child pages doesn'twait, it started working but without showing the parent. this bit of messy code shows the parent as a heading then lists children
<?php $parent = get_the_title($post->post_parent); if (is_page() && $post->post_parent ) { ?> <h4><a href="<?php echo get_permalink($post->post_parent) ?>"><?php echo $parent;?></a></h4> <?php } ?> <?php if($post->post_parent) $children = wp_list_pages("title_li=&child_of=".$post->post_parent.""); if ($children) { ?> <ul><?php echo $children; ?></ul> <?php } ?>
Forum: Plugins
In reply to: [All-in-One WP Migration and Backup] broke websiteI forgot to mark this as resolved. I still don’t know why the database borked or the admin email changed, but the other problems were fixed when I added a new admin and used that profile.
So except for noting that quick access to the database in case of lockout is a good idea, I would recommend this plugin for when replacement of everything is preferable to regular import. I’m especially impressed with your responses here and attempts to help. Thank you!
Forum: Fixing WordPress
In reply to: WP 4.4, no visual editor and edit barturns out there was something wrong with my user settings, so I created a new user and am able to see the visual edit again.
Forum: Plugins
In reply to: [All-in-One WP Migration and Backup] broke websiteI don’t know. The posts/pages/media moved and the advanced custom fields are all in place. It looks like some other info in database is untouched (like form fields) but some is suddenly gone (like an add-on to those form fields).
Now the visual editor and extended toolbar are gone. I don’t know what’s related to moving or something else.
The development server is not windows but the new server is. I’m suspecting something is funny on this windows server and that may be the root of all issues, including the database mess up on migration–although the user email changing doesn’t make sense for any issue.
Forum: Plugins
In reply to: [All-in-One WP Migration and Backup] broke websiteI believe the problem was mainly that the admin email was changed — the same username was used on both old and import site but neither had the email address it changed to.
Then the new theme had a problem and I couldn’t get a password reset because of the incorrect email.
After I was able to set up a new admin in mysql I could get back in, and found that import/rewrite had worked.Forum: Hacks
In reply to: help to fix php error: strlen() expects parameter 1 to be string, array givenDid not exhaust google skills after all!
I had to switch to if not empty. so this works:
<?php $topic_tags = get_sub_field('topic_related_tags'); $topic_post = get_sub_field('related_post'); $topic_page = get_sub_field('related_page'); if (!empty($topic_tags) || !empty($topic_post) || !empty($topic_page )) { echo '<h4>My title</h4>'; } ?>