How can I get the sidebar id on the current page?
How can I get the sidebar id on the current page?
How can I get the sidebar id on the current page?
register_sidebar() will not wrap an element properly
Try this <?php echo get_comments_number( $post[‘ID’] ); ?>
Okay so it works now. The data from the name input is now displayed on front end along with the uploaded image. I honestly can’t explain why… but I basically just copied some lines from the tutorial link I posted and pasted it where it belongs and everything started to work the way it should. … Read more
When you use is_active_sidebar and dynamic_sidebar the argument needs to match the id of a registered sidebar in your theme. In your case that is going to be home_right_1 not sidebar-1 as in the code you copied. Technically, the sidebar name should also work in both and the sidebar index number should work with is_active_sidebar … Read more
My Email Newsletter plugin will not configure when I try to import the widget
I will put a basic code to create new widget. In WordPress its call register_sidebar; In your code, you have not put ID. Id=>your-widget-id Put this code into your functions.php function my_widget(){ register_sidebar( array( ‘name’ => __( ‘Front Sidebar’, ‘yourtheme’ ), ‘id’ => ‘sidebar-1’, ‘description’ => __( ‘This is description’, ‘yourtheme’ ), ‘before_widget’ => ‘<aside>’, … Read more
on line 49 it seems you have hardcoded in the checkbox value it should actually look like this, it was always going to be true even if it did work as intended: <input id=”<?php echo $this->get_field_id(‘checkbox’); ?>” name=”<?php echo $this->get_field_name(‘checkbox’); ?>” type=”checkbox” value=”<?php echo $checkbox; ?>” <?php checked( ‘1’, $checkbox ); ?> /> also after … Read more
Solution used: // decide to show or hide the widgets function check_for_using_template(selected){ if (selected == “page-templates/core-front-page.php”){ jQuery(“#page-core-home-1”).show(); jQuery(“#page-core-home-2”).show(); jQuery(“#page-core-home-3”).show(); jQuery(“label[for=”page-core-home-1-hide”]”).show(); jQuery(“label[for=”page-core-home-2-hide”]”).show(); jQuery(“label[for=”page-core-home-3-hide”]”).show(); }else{ jQuery(“#page-core-home-1”).hide(); jQuery(“#page-core-home-2”).hide(); jQuery(“#page-core-home-3”).hide(); jQuery(“label[for=”page-core-home-1-hide”]”).hide(); jQuery(“label[for=”page-core-home-2-hide”]”).hide(); jQuery(“label[for=”page-core-home-3-hide”]”).hide(); } } jQuery(document).ready(function(){ check_for_using_template(jQuery(“#page_template”).val()); jQuery(“#page_template”).change(function(){ check_for_using_template(jQuery(“#page_template”).val()); }) }); Unfortunately, I was unable to successfully utilized the is_page_template, so I used jQuery. Works, though it may not … Read more
Add class from custom field into widget class