Hide/Show panel not showing – ACF
It is probably because of jQuery/javascript conflict. Try disabling all other plugins and enable them one after another to see which causes the issue.
It is probably because of jQuery/javascript conflict. Try disabling all other plugins and enable them one after another to see which causes the issue.
add_post_meta doesn’t call the same hook again but there are some other functions such as wp_update_post which call the hook again. In case it is going into infinite loop you’ll have to call remove_action inside the function to not make it recursive
You can check current_post in the loop. Just remember it’s zero-indexed, so first is 0, second is 1, etc.: if( 0 == $employee->current_post ): // this is the first post else: // this is > first post endif;
If you can grab your data early enough you can do this: function alter_title($t) { return ‘altered-title’; } add_filter(‘pre_post_title’,’alter_title’); add_filter(‘pre_post_name’,’alter_title’); That will change the title and the slug before the post is saved. Of course, you need to work out some logic for that function. As is, it changes all post/page/CPT names and slugs on … Read more
A few points: Instead of while(): endwhile; Use while() { } You didn’t check to see if any posts were found, if($loop->have_posts()){} will do the trick You didn’t cleanup after your query, inside the if statement mentioned above, make a call to wp_reset_postdata(); before your closing brace Avoid generic variables like $query for your args … Read more
From Wikipedia Animalia is the taxonomic kingdom comprising all animals (including human beings). From the Codex Taxonomy is one of those words that most people never hear or use. Basically, a taxonomy is a way to group things together. For example, I might have a bunch of different types of animals. I can group them … Read more
Less code lines with get_post_custom_values() $values = get_post_custom_values(‘slider_id’, $post_id); // if non-empty if($values) { foreach($values as $value) echo get_new_royalslider($value); } If $values array is empty, nothing happens.
It’s a little complicated, but we can do this by directly modifying the query with a filter on posts_where. We’ll start with a query for posts with a meta value of today’s date, this is assuming a date format of yyyy-mm-dd: $date_today = date(‘Y-m-d’); $args = array( ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ … Read more
I don’t know what $dorigen is – but you can’t find your </h3> because of your if/else condition. I don’t see why the else is needed at all. Replace else { ?> </h3><?php } ?> with </h3> in both places it is used. That said, if you only want to show the entire post-meta div … Read more
Rather than outputting all rows, you can check each row in a loop and only output it if something matches. In this example, there’s a treatment field within the repeater that is the value of the name of the treatment post. If the two match, output the other values: $other_page = 89; $practioners = get_field( … Read more