Display current tag archive’s name and description in sidebar
Display current tag archive’s name and description in sidebar
Display current tag archive’s name and description in sidebar
Technically “off topic” here as your actual question is open-ended and there is lots of room for opinion. https://wordpress.stackexchange.com/help/dont-ask Sidebars and widgets are a perfect way to organize these elements. Keep in mind these are simply tools to organize blocks for repeated use in various locations. So, officially, my answers to your two questions are: … Read more
Shouldn’t “function widget( $args, $instance )” be “public function widget( $args, $instance )”? Reference: WPBeginner
Naive repeatable are impossible with widgets as the data structure and UI tend to be rigid. On the face of it, the way you describe it in the question, you can just use the media library to select multiple images instead of one, and keep them as a list of attachment IDs. You should take … Read more
My widget was like this: public function __construct() { $widget_ops = array( ‘classname’ => ‘yggdrasil_widget_recent_entries’, ‘description’ => __( ‘Your site’s most recent Posts.’ ), ‘customize_selective_refresh’ => true, ); parent::__construct( ‘recent-posts’, __( ‘Recent Posts’ ), $widget_ops ); $this->alt_option_name=”yggdrasil_widget_recent_entries”; } Below works as a new widget without overriding the default wordpress recent posts public function __construct() { … Read more
Where is this function hooked? widgets_init is hooked into init at priority 1, but WooCommerce registers its taxonomies in init at priority 5. So if you use widgets_init as the hook you won’t be able to use get_terms() because it returns a WP_Error if the taxonomy isn’t registered. You’ll need to register the widget on … Read more
Thanks to Tom J Nowell I found out that the reason for after_widget and before_widget NOT appearing was that I used my own widget and inside my own widget I had commented out: //echo $args[‘before_widget’]; and //echo $args[‘after_widget’]; So as soon as I tested it with the default wordpress “Custom HTML” everything worked fine and … Read more
How do I enable the admin form for a custom widget that is called in a sidebar template, not to widget area?
Widget settings disappear after refresh
$supernews_cat_post_args = array( ‘posts_per_page’ => $supernews_number, ‘no_found_rows’ => true, ‘post_status’ => ‘publish’, ‘ignore_sticky_posts’ => true ); This is the code where you should add the pagination. Changing it to: $paged = ( get_query_var( ‘paged’ ) ) ? get_query_var( ‘paged’ ) : 1; $supernews_cat_post_args = array( ‘posts_per_page’ => $supernews_number, ‘no_found_rows’ => true, ‘post_status’ => ‘publish’, ‘ignore_sticky_posts’ … Read more