How to use extract shortcode in loop?
Have you tried echo do_shortcode(‘[your_shortcode attribute1=”value” attribute2=”another”]’); this should fire the shortcode function in PHP
Have you tried echo do_shortcode(‘[your_shortcode attribute1=”value” attribute2=”another”]’); this should fire the shortcode function in PHP
Problems With Query and/or Template Part and/or PHP
How to add an empty entry to masonry?
Solved by getting author, post_date, permalink & excerpt manually without setup_postdata: $excerpt = myCustomExcerptFunction($post, 35); $post->post_excerpt = $excerpt; // Permalinks $post->post_permalink = get_post_permalink($post->ID); // Author $authorObjekt = get_userdata($post->post_author); $post->post_author_displayname = $authorObjekt->data->display_name; $post->post_author_nicename = $authorObjekt->data->user_nicename; // Date $post->post_date_wpformat = date_i18n( get_option( ‘date_format’ ),
Where are you getting these tags from? Typically, to get a list of tags attached to a post, you’d do: $some_tags = wp_get_post_tags( $post_id); and then itterate through as such: foreach($some_tags as $tag) { do stuff }
Sorting Posts Based On Meta Value Using AJAX
Closing off as the issue is resolved. For anyone interested, the result is as follows (refer to the code detailed above for the initial DB-table connections, as the code below refers to the output only): if (isset($SelectedLocationID) && isset($SelectedSchoolID)) { ?> <div id=”resultsDiv”> <div id=”resultsHead”> <h3>Search results for routes between:</h3> <b><?php echo $selectedLocationName; ?></b> and … Read more
You’re only referencing the event date in your query, which is why you’re not getting normal posts (because I assume they don’t have an event date). You can use “orderby” with multiple values (separated by a space), so you should be able to change it to: ‘orderby’ => ‘meta_value date’ That should mean that the … Read more
Where should get_post_meta() go to get $post->ID get_post_meta() is empty and $post->ID & get_the_id() are working
So based in the information you’ve given me in the comments the following gist should work as you have described with your current setup. https://gist.github.com/aj-adl/fab2cefd1450cbf24a5c You provide it with a region, and it will get all posts from a region, loop through and build an array of producers, then do a subquery and loop for … Read more