Proper WP conditional tag to check for existing taxonomies to list out terms with wp_list_categories?

is_tax() returns true on a taxonomy archive page, it has nothing to do with whether terms exist in a taxonomy. you just need to add a check for anything returned from wp_list_categories before outputting any markup: <?php $args_list = array( ‘taxonomy’ => ‘productcategory’, ‘title_li’ => __(”), ‘show_count’ => false, ‘hierarchical’ => true, ‘echo’ => ‘0’, … Read more

For what queries is conditional tags informative?

is_category(‘apple’) might give a false response if “banana” AND “apple” has been queried you’re using is_category incorrectly in this context. From Codex: is_category(); // When any Category archive page is being displayed. A category archive page is for a single term, if a query is a for more than one term, it’s not a term … Read more

Display a widget on a specific type of archive

You could use the is_tax() function to accomplish this. The first parameter, the taxonomy slug is optional, but you do want to specify it. This would be something like product-categories. The second, a specific term, is also optional. It’d be perfectly acceptable to have the following: is_tax(‘product-categories’);

Conditional tag to determine if the user is viewing the Add Media (after clicking Add media button)

There are multiple actions available. Demo: add_action( ‘upload_ui_over_quota’, ‘wpse_78085_callback’ ); add_action( ‘pre-upload-ui’, ‘wpse_78085_callback’ ); add_action( ‘pre-plupload-upload-ui’, ‘wpse_78085_callback’ ); add_action( ‘post-plupload-upload-ui’, ‘wpse_78085_callback’ ); add_action( ‘post-upload-ui’, ‘wpse_78085_callback’ ); function wpse_78085_callback() { # see wp-includes/media-template.php print ‘<pre>’ . current_filter() . ‘</pre>’; } Result:

Only on single post page

If you mean a single post, not a page then use the conditional tag is_single() and check for this, like: function demo_link() { if ( is_single() && in_category( ‘themes’ ) ) { // Some code #1 } else { // Some code #2 } } add_action( ‘thesis_hook_after_post_box’, ‘demo_link’ ); If you will use it on … Read more

Add class to DIV depending on page loaded

You might want to consider using the WordPress function body_class() <body <?php body_class($class); ?>> Then you could use the body class as your current page reference. This function is for example used by the Twenty-Twelve theme. For a single post it will become <body class=”single single-post …”> and for the home page: <body class=”home blog … Read more

Conditional display faults

is_page() returns boolean true or boolean false. The way you’ve called it looks like it would have no effect. Try this: if ( is_page( array( ‘web-design-portfolio’, ‘web-design-portfolio-2’ ) ) ) { ?> <!– All your display code code –> <?php } // ends the if() statement

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