Script that gets the first tag of post and query all other posts with the same tag

the query expects the tag slug, not the tag name: $tag = $tag->slug . ‘ ‘; and there is an error in the query syntax; corrected: query_posts(‘tag=’.$tag.’&posts_per_page=-1′); edit: full code rearranged: $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { $tag = $tag->slug; break; } query_posts(‘tag=’.$tag.’&posts_per_page=-1′); while (have_posts()) : the_post(); ?> <p><a href=”https://wordpress.stackexchange.com/questions/27106/<?php the_permalink(); … Read more

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

Static Website No Titles But Still Nav

Somewhere in your page.php template will be a tag containing the_title(), and that’s what you have to delete. In my WordPress theme, for example, the code looks like this: <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <div class=”entry”> <div <?php post_class(); ?>> <div class=”post-meta”> <h1><?php the_title(); ?></h1> … Read more