How to check if the current page is at a specified path in the URL?

You could try this instead if (!is_front_page() && is_home()) { get_template_part(‘template-parts/blog-categories’); } Explanation for the difference between front_page an home is here: https://wordpress.stackexchange.com/a/239838 if you set a page as a blog-page it is “home”, in your case the landing-page is the so called “front_page”. This is WordPress specific.

Exclude a category from a query that includes its parent category

First you should move wp_reset_query(); outside of the loop instead of resetting the query every post of the loop. And as for your query you can use category__not_in $args = array( ‘cat’ => 14, ‘category__not_in’ => array(’45’), ‘posts_per_page’ => 20 ); $the_query = new WP_Query($args); while ($the_query->have_posts()) : $the_query->the_post();?> <li> <a href=”https://wordpress.stackexchange.com/questions/17387/<?php the_permalink() ?>” rel=”bookmark” … Read more

Dynamically output a class to an anchor tag depending on what tag is chosen

Sounds like you’d want to use this: http://codex.wordpress.org/Function_Reference/wp_get_object_terms If you’re using a custom taxonomy, add that where it says “post_tag”. unset($tags); foreach(wp_get_object_terms($post->ID, ‘post_tag’) as $tag) : $tags .= ‘ ‘ . $tag->name; endforeach; And then add it to your anchor tag: <a href=”https://wordpress.stackexchange.com/questions/36707/<?php the_permalink(); ?>” title=”View Item” class=”product_view_sm<?php echo $tags; ?>”>..View Item..</a>

Conditionals if tags exist?

Try this <?php $related = new WP_Query( ‘tag=’ . get_the_title() . ” ); if( $related->have_posts() ): <h1>Related Articles</h1> while ( $related->have_posts() ) : the_post(); ?> <li><a href=”https://wordpress.stackexchange.com/questions/48774/<?php the_permalink() ?>”><?php the_title(); ?></a> </li> <?php endwhile; else: //there are no related articled endif; wp_reset_postdata();?> EDIT You should not use query_posts for a secondary loop. The query_posts alters … Read more

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