Tables not showing divs and loop/php items

In your page template line 42 you will see <?php if ( is_archive() || is_search() ) : //display excerpts for archives and search. ?> <?php the_excerpt(); ?> <?php else : ?> <?php the_content(‘Read More’); ?> <?php endif; ?> This means that there won’t be a heading on archive pages and the_excerpt doesn’t allow html like … Read more

Displaying posts on Homepage

Try the following using WP_Query: <div class=”news-column”> <h3>Latest News</h3> <ul> <?php //get news $args->posts_per_page = 5; //query $query = new WP_Query($args); while($query->have_posts()):$query->the_post(); ?> <li class=”news-item”> <h4><?php the_title(); ?></h4> <p><?php the_date(‘F jS, Y’); ?></p> <?php the_excerpt(); ?> <p class=”footnotes”><a href=”https://wordpress.stackexchange.com/questions/69725/<?php the_permalink(); ?>”>Continue reading</a></p> </li> <?php endwhile; wp_reset_postdata(); ?> </ul> </div> You can read more about other … Read more

Adding if statement to content for homepage

Check for is_front_page() and if you want to catch the first page only inspect get_query_var( ‘paged’ ) too: if ( is_front_page() and 2 > get_query_var( ‘paged’ ) ) { // we are on the first page of the front page }

Show last post from multiple categories using wp_list_categories

Get all children categories using get_terms(). Loop through each term and run a new query using tax_query. Example: <?php if ( get_queried_object()->parent == 0 ) : // parent cat ?> <h2>Showing all children</h2> <?php $args = array( ‘hide_empty’ => false, ‘parent’ => get_queried_object()->term_id ); $terms = get_terms( ‘category’, $args ); if ( $terms ) echo … Read more

Using pagination with multiple loops causes it to break

The first problem can be solved by changing the query_posts in your work section. Replace ‘&category_name=work’ with ‘&category_name=work&paged=1&posts_per_page=-1’ For the second problem, why not use the category template itself in place of index.php? As a side note, you should not use query_posts for this use case. In place of that you should use a new … Read more

stuck with template hierarchy

I found a solution by changing my categories.php to category-slug.php and then putting the standard loop back into the the category.php file. All seems good now.

issue displaying variations in custom template using WPeC 3.8.9.2

If you look at the default wpsc-products_page.php template, it uses while (wpsc_have_products()) : wpsc_the_product(); instead of have_posts() and the_posts() to setup the loop. The wpsc_the_product() function sets up a global $wpsc_variations object that the product variation functions use. I think in order to use wpsc_the_product() you need your query to be the global $wp_query, but … Read more