Widget logic conditional widget

Before I start, I must say that your terminology is quite confusing and plain wrong. You should take your time and read through my answer to this question: Is There a Difference Between Taxonomies and Categories? As I stated before, there is no in_term() function to check if a post has a specific term. There … Read more

WP conditional site logo and header block

Considering you’ll use multisite and for adding logo you just need to go to individual site and enable option to add logo(will be available in the theme you are using). Next step is to alter header.php from your theme and add following lines of code where you have the_custom_logo(); TO: switch_to_blog( $blog_id ); //where `$blog_id` … Read more

Generating images from an array of categories

is_category() takes an array as arguments if you want to check for more than one category. But you can make it even easier with a check for existing files: if ( is_category() ) { $slug = get_queried_object()->slug; $theme_path = “/images/slider_$slug.png”; $file = get_template_directory() . $theme_path; if ( file_exists( $file ) ) { echo ‘<img src=”‘ … Read more

Conditional loading of CSS for my plugin

Since WP 3.3 you can use wp_enqueue_*() after wp_head, and enqueued scripts and styles (if not already added to the head of the page) would be loaded in the footer. In short just call wp_enqueue_script() / wp_enqueue_style() in your shortcode callback: add_shortcode( ‘my_shortcode’, ‘my_shortcode_callback’ ); function my_shortcode_callback(){ //Shortcode does something, and generates mark-up to return … Read more

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