Several loops in sidebar issues

Have you tried calling <?php wp_reset_postdata(); ?> after the ehdwhile; for each custom loop? EDIT Next step is to try calling <?php wp_reset_query(); ?> instead of <?php wp_reset_postdata(); ?> after the ehdwhile; for each custom loop. Note: see here for a nice explanation of the different ways to reset the WordPress loop. Note 2: problem … Read more

List ALL posts by author on author archive

your get_posts overrides the normal query_posts query. For this to work properly you should use query_posts and merge in your numberposts setting with the original query, like so: global $wp_query; $args = array_merge( $wp_query->query, array( ‘numberposts’ => -1 ) ); query_posts( $args ); Then you’ll no longer need a custom loop either, you could just … Read more

Offset for Loop

It’s a php error probably because its expecting either one of your if statements to be closed before the endwhile. It’s hard to tell without seeing all the code but at a guess check this one is closed: if ($tags) { also I would wrap your foreach in curly brackets. Maybe just preference though… foreach($tags … Read more

How to create multiple loop in archive page?

I would avoid this kind of excess indentation at all costs, however this should work although I haven’t tested it. Please let me know if there are syntax errors so that I can correct them. <!– first loop : 1 post –> <?php if ( have_posts() ): the_post(); ?> <a href=”https://wordpress.stackexchange.com/questions/31361/<?php the_permalink() ?>” rel=”bookmark” title=”” … Read more

Add 2 values to post__not_in

This should display 5 posts per page (-1 for all of them on one page), with the post ID’s $value1 and $value2 being ignored. Ensure $value1 and $value2 are integers. $args = array( ‘numberposts’ => 5, ‘posts_per_page’ => get_option(‘posts_per_page’), ‘paged’ => $paged, ‘post__not_in’ => array( $value1, $value2 ) ); query_posts($args); EDIT – With the further … Read more

Is file_exists() compatible with timthumb.php? [closed]

The file_exists() function is a built in php function and should work everywhere. But with the way you’re doing it, is wrong. You cannot use a query string within a php file to check if the file exists. Just because its a valid link, doesn’t mean the file_exists(). There is no file on your server … Read more

Open Graph in Index Loop

Short answer: you can’t do that, that’s not what OpenGraph data is, does, or how it works. Long answer: OpenGraph applies to the single post pages only, realistically. When you’re putting a like button (for example) onto each post on a archive page, the like button is going to point to the permalink of the … Read more

Loop info in jquery Tabs – loop into a variable?

You would have to perform the query for each respective tab. If you are using WP_Query then you can perform the query and then use $found_posts to return the total number of posts matching that query. For instance, $query_tab_1 = new WP_Query($args); //Where $args is some arguments for your query $tab_1_count = $query_tab_1->found_posts; The $query_tab_1 … Read more