How to get sidebar’s content inside admin-ajax?
How to get sidebar’s content inside admin-ajax?
How to get sidebar’s content inside admin-ajax?
Add Icons to the Product Category Sidebar Widget WooCommerce
How To Remove/hide some specific categories from two different categories widget from sidebar
Call wp_get_sidebars_widgets(), and loop through each sidebar. Off the top of my head, text widgets have an ID like widget_text-$i.
Well the simplest way I can think of is something like this… <ul class=”categories”> <?php $categories = get_categories(); //can add parameters here to swtich the order, etc; if(!empty(categories)): foreach($categories as $i => $category): ?> <li class=”category”> <span><?php echo $category->name ?></span> <?php query_posts(‘posts_per_page=-1&cat=” . $category->term_id); if ( have_posts() ) : ?> <ul class=”posts”> <?php while ( … Read more
I believe @One Trick Pony was right. Shortcode widgets have no ID, so I’ve found a way around. Firstly I used PHP rand function: $var = rand(); And then added the “var” to the ID, so it doesn’t collide with other shortcodes calling the same widget (each one has different random number at the end … Read more
just add <?php get_sidebar(); ?> to page.php in your child theme and all pages will have a sidebar. look at sidebar-page.php to see where to place it.
Check if searchform is included? The get_search_form() function (that should be used) uses locate_template(‘searchform.php’); to display the search form. The later returns (as you can see from its source) the template filename if one is located So if you’re just wanting to catch the default way, then you should simply test ‘searchform.php’ === locate_template( ‘searchform.php’ … Read more
Try giving a unique ID to each dynamic sidebar, via the id parameter passed to register_sidebar(): register_sidebar( array( ‘id’ => ‘essential’, ‘name’ => __(‘Essential Plan’), ‘before_widget’ => ”, ‘after_widget’ => ”, ‘before_title’ => ”, ‘after_title’ => ” ) ); register_sidebar( array( ‘id’ => ‘premier’, ‘name’ => __(‘Premier Plan’), ‘before_widget’ => ”, ‘after_widget’ => ”, ‘before_title’ … Read more
If you’re video embeds are always the same, I like the solution proposed by 5wpthemes, but if you want to avoid having to use a custom field ( and more specifically, remembering to do it), you could also try the code below ( which also requires the code to be very similar in every post … Read more