How to add the sidebar in all category page

the following code will work as for per your custom post type add the following code in sidebar.php to show your custom post type category <?php //list terms in a given taxonomy using wp_list_categories (also useful as a widget) $orderby = ‘name’; $show_count = 0; // 1 for yes, 0 for no $pad_counts = 0; … Read more

Call sidebar from a template

Impossible with get_sidebar(). From that function’s body: function get_sidebar( $name = null ) { do_action( ‘get_sidebar’, $name ); $templates = array(); if ( isset($name) ) $templates[] = “sidebar-{$name}.php”; $templates[] = ‘sidebar.php’; So if you pass a $name or any other custom value to the function, they will be set between two fixed strings. You can … Read more

How to display a sidebar only for blog?

First: is_page() expects a page id, so the call would be is_page(35). Second: get_sidebar needs to be called from the template (not the functions file). You probably already have two templates setup: page.php – In here you’ll call get_sidebar(‘primary’); index.php (assuming your blog is on the home page) – In here you’ll call get_sidebar(‘secondary’); Please … Read more

user definable sidebar per page

There’s a brute force method you can use. When you register your sidebar, you give it an ID and a name, then you use that ID and name on the sidebar template to display it. What if you appended the ID of the page to that identifier? So instead of ‘mainsidebar’ you had ‘mainsidebar’.$post->ID? Step … Read more

Only display on sidebar if only got value inserted on post

Try using this: // Get the ‘WpForest_soft’ custom field value. $text = get_post_meta( $post->ID, ‘WpForest_soft’, true ); // Print the value and surrounding markup only if the value tests true. if ( $text ) printf( ‘<tr><td class=”attr-name”>%s</td><td class=”attr-detail”>%s</td></tr>’, __( ‘Software Version’, ‘WpForest’ ), $text ); General Case To do the above with any optional markup … Read more

Page specific values in widgets

Add the data to your pages as Custom Fields, then use one of the meta functions in your sidebar to display this data. Note that the custom fields UI may be hidden from view on pages. If this is the case, click the Screen Options tab in the upper right corner and tick the box … Read more

Placing video content into a sidebar

You can add a meta field along with your post which contains image/video fram url. Now write a plugin or some PHP code which access particular meta tag of a post. And display it. As an alternative you can use some plugin like amtyThumb

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