How to get all posts in gallery post format template
How to get all posts in gallery post format template
How to get all posts in gallery post format template
Im guessing it is because you are using echo the_post_thumbnail_url(array(300, 150)); instead of the_post_thumbnail_url(array(300, 150)); the_post_thumbnail_url echos the output for you. Another observation, the the_post_thumbnail_url uses the post data that is setup using setup_postdata, so there is no need for these two lines: $thumb_id = get_post_thumbnail_id($post, ‘news-image’); $url = wp_get_attachment_thumb_url($thumb_id, ‘300, 300’);
Sorry guys…I actually inherited this install from someone else. The problem was a plugin (BEEP, https://wordpress.org/plugins-wp/brilliant-easy-exclude-posts/ )…It was causing my meta_queries not to work at all. I’m going to file a report with the plugin folks.
how to avoid reloading/refresh the page when displaying the post of wp_list_categories
Since the queries are not related to each other, there is no other way around it. You are going to end with with many queries and slow page (when it is not cached) on a site with many categories. A better approch may be to show latest 50 posts, and display them by category, but … Read more
you need to find out your exact CPT name (is it just services?) and that will be the archive-services.php and single-services.php. Those need to be either in your theme folder or if you’re using a child theme (you should be) these files will be in your child theme folder. show us the code to create … Read more
Some arguments for your query are with variables, we don’t know how you define them in the function. i.e : $posts_not_in can be the same or not. And will change your results. Same for $terms. You maybe need to introduce an offset var and add it to each query.
You have mistake here: ….. $news = $temp_news.get_post(); remove .get_post() from there.
You can first get posts from your featured category and check if it has any posts or not. If yes, you will show them. If not, you will make another query that will get 3 posts from random categories (as you described) and show them. $events_args = array( // include the code in your question … Read more
Have you tried the last parameter with ASC like ‘order => ‘ASC’ ? I think it will solve your problem. So your full code will be like- // get posts $posts = get_posts(array( ‘post_type’ => ‘events’, ‘posts_per_page’ => 2, ‘meta_key’ => ‘from_datetime’, ‘orderby’ => ‘meta_value’, // Here is the main trick happening. ‘order’ => ‘ASC’ … Read more