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

Displaying posts limit: can’t get pagination to display [duplicate]

Try reviewing this page on the codex. Using your above template, I would suggest the following: <?php if ( is_user_logged_in() ) : $args = array( ‘posts_per_page’ => ‘5’, ‘author’ => get_current_user_id(), // Removes a few lines of code 😉 ); $author_posts = new WP_Query( $args ); ?> <?php /* Author has posts? */ ?> <?php … Read more

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