Widgets not showing on sidebars

You’ve registered your sidebars with the ids of sidebar-left and sidebar-right but you are are attempting to display them using only left and right. You need to use the correct ids. That is: dynamic_sidebar( ‘sidebar-left’ ); You need that id with both dynamic_sidebar() and is_active_sidebar() if ( is_active_sidebar( ‘sidebar-left’ ) ) { dynamic_sidebar( ‘sidebar-left’ ); … Read more

Sidebar not appearing on page template with custom posts

What you have is probably a bad structure… The sidebar itself should not be inside the loop since it might contain (the widgets inside it) multiple loops that would break your code. This is the “right structure” PAGE HEADER PAGE SIDEBAR (POSITION OPTIONAL) CONTENT AKA LOOP PAGE SIDEBAR (POSITION OPTIONAL) PAGE FOOTER As you can … Read more

Allow different tags in widget titles

I did not understand what you are doing in the function. See below example how title can be wrapped in the html tag: function html_widget_title( $title ) { $output=”<span class=”icon-someicon”>”; $output .= $title; $output .= ‘</span>’; return $output; } add_filter( ‘widget_title’, ‘html_widget_title’ );

Posts to have category specific sidebars with the widgets

Create a child theme (if you haven’t already) and register two sidebars: function wpse_151695_register_sidebars() { register_sidebar( array( ‘name’ => ‘News’, ‘id’ => ‘sidebar-news’, ) ); register_sidebar( array( ‘name’ => ‘Blog’, ‘id’ => ‘sidebar-blog’, ) ); } add_action( ‘widgets_init’, ‘wpse_151695_register_sidebars’ ); Then in your sidebar.php: if ( is_singular() ) { // For single posts, show the … Read more

Custom Sidebar in Editor (not Widget) for Custom Post Type in Genesis

For anyone with the same problem, here’s the answer. I finally figured it out. // Display Profile Sidebar ACF add_action(‘genesis_sidebar’, ’employee_title’); function profile_photo() { if ( is_singular(‘profile’) && genesis_get_custom_field(’employee_title’) ) echo ‘<div id=”employee-title”> ‘. genesis_get_custom_field(’employee_title’) .'</div>’; } This is the the hook location in Genesis where the custom field data needs to output to: genesis_sidebar. … Read more

How to only show parent categories in sidebar

You can create a custom widget for that. // Widget Class ============================== class WPSE154979_Widget extends WP_Widget { function WPSE154979_Widget() { $widget_ops = array( ‘classname’ => ‘WPSE154979_custom_widget’, ‘description’ => __(‘Post Category Children\’s or Parent Categories’) ); $control_ops = array( ‘width’ => 200, ‘height’ => 400); $this->WP_Widget( ‘WPSE154979_custom’, ‘Custom Categories’, $widget_ops, $control_ops ); $this->alt_option_name=”WPSE154979_custom”; } function widget( … Read more

New Widget are not showing

If you register a new sidebar widget area in a child theme, use this code in your child themes functions file: register_sidebar( array( ‘name’ => ‘Header Widget Area’, ‘id’ => ‘home-header-1’, ‘description’ => __( ‘Your Widget Description.’, ‘$text_domain’ ), ) );

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