How to show only specific tag in wordpress loop

Here are two alternative for you based on your actual query. If you’re querying $projects->have_posts() on WP default blog (Post) you can use query like $projects = new WP_Query( array( ‘tag__in’ => array( 52, 53 ) ) ); Another is if you’re querying on Custom Post Type you can use following query to get posts … Read more

Having issue with WordPress loop

As per the documentation I am doing everything right, but on the frontend, it is not showing all of the posts, Any idea what I am doing wrong? The documentation does not say to use a custom page template for displaying the blog archive. As shown in the template hierarchy the template for your blog … Read more

Creating mulitple loops in a sub-category page

I figured this out on my own. I use the code below and duplicated it as many times as I needed without any issues so far. If anyone thinks this is incorrect than please comment. I was not using the main loop anywhere else on this page and used WP_Query. <ul class=”subcats-list”> <?php $weightloss = … Read more

Loop from another WP site onto mine

If you want to grab info right off the page you should use one of these options if you don’t want a plugin, the content can be returned and parsed as xml, rss, json or just html/text. This is the proper way to do this. WordPress HTTP API: http://codex.wordpress.org/HTTP_API or fetch_feed() ( for rss only). … Read more

How to end this loop properly?

Let’s throw everything, but loop out: if ($my_query->have_posts()) { // open container around all posts while ($my_query->have_posts()) : $my_query->the_post(); // output for every post endwhile; // close containers around all posts } As you see: output of posts goes inside while loop as usual; opening larger containers is between checking if we have posts and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)