Entirely Different Functions.php per Page?

functions.php will load automatically for every page load, but you could certainly move most of the content of your current functions.php to other files and use functions.php itself as a primarily a kind of switch. Caveat: You may have to hook some of your switching functions to get access to certain data. For example, functions.php … Read more

Cannot retrieve active members only

Curly braces for foreach is missing. Try this: /* Template Name: Directory */ add_action( ‘genesis_entry_content’, ‘ogs_directory’, 5 ); function ogs_directory() { $args = array( ‘blog_id’ => 1, // unless yours is a multisite install, you shouldn’t need to change this ‘exclude’ => array(), // IDs of users that need to be excluded ‘orderby’ => ‘display_name’ … Read more

Conditional css for custom post type

Two things are important here, your taxonomy is portfoliosets, which mean this is not a built-in category. videos and magazines are terms of your taxonomy. From what I can make from your question, you need to show different header image for different single post page view depending on the term a post belongs to. Based … Read more

Conditional category & tag statement

I think your problem lies in is_category(). This conditional check if you are on a category page, not if a post belongs to a category. To check if a post belongs to a category, you should be using has_category So your conditional statement should be <?php if (has_category(‘Legal Libation Columns’) && has_tag(‘Legal Libation Columns’)): ?> … Read more

How can have a conditional template tag based on the main loop within a secondary loop with new WP_Query(), using get_template_part()

You can ask the main query directly (which is, in fact, exactly what the is_front_page function is doing). <?php global $wp_query; ?> <?php if ( $wp_query->is_front_page() ) : ?> <div><?php the_content(); ?></div> <?php endif; ?> If you altered the main query, however, refer to the backup. <?php global $wp_the_query; ?> <?php if ( $wp_the_query->is_front_page() ) … Read more

Using conditional staements to load plugins

figured it out… The main problem with the scripts so just wrapped them in this for each plugin: function my_enqueue_javascript() { if (is_page(‘page’)) { //Include Javascript library wp_enqueue_script(”, plugins_url( ‘/js/ajax.js’ , __FILE__ ) , array( ‘jquery’ )); // including ajax script in the plugin Myajax.ajaxurl wp_localize_script( ”, ‘MyAjax’, array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’))); } } … Read more

If less than IE9 [closed]

Here is my ammended version of your code: <?php if( is_ie() && get_browser_version() < 9 ) { if ( is_active_sidebar( ‘countdown-ie’ ) ) { dynamic_sidebar( ‘countdown-ie’ ); } else { ?> <div class=”pre-widget”> <p><strong>Widgetized area 1</strong></p> <p>This panel is active and ready for you to add some widgets via the WP Admin</p> </div> <?php } … Read more

Comparison Operators not working for conditional author post thumbnails

You are using wrong Comparison Operators. Use else if($author_id == “2”) { instead of else if($author_id = “2”) { Edit: Try adding trailing slash after get_stylesheet_directory_uri function. its missing in your code. <img src=”https://wordpress.stackexchange.com/questions/166850/<?php echo get_stylesheet_directory_uri() ?>/images/default-thumb.jpg” alt=”” title=”” width=”” height=”” />

Pre Get Posts – Difference between conditional() and $query->conditional()?

There’s a big difference… most of the times. is_home(), just like any other conditional tag, check main query. $query->condition() check the query object that is passed by action, that can be a a completely different query, because pre_get_posts is called for all queries. As example, let’s assume you are viewing a singular post, and inside … Read more

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