Widget for specific category

I’d start with a basic widget tutorial. From there, I’d add a dropdown on the widget back end that lists out all the categories, so you can select from existing categories. Then on the widget front end, I’d do a WP_Query to pull a specific number of posts from that category. With posts selected, do … Read more

What is the best way to build home pages with a lot of sections for distributable themes [closed]

Due to historical context implementation of static front pages in WordPress is, simply put, a horror. This is not something it was meant to do originally and the way it was bolted on at a certain point is opposite of smooth. Under these constraints it would be hard to impossible to say what would be … Read more

How to add custom tinymce plugin to new text widget

I found the solution with help from Jacob Peattie and the article from https://make.wordpress.org/core/2017/05/23/addition-of-tinymce-to-the-text-widget/ Here’s a quick walkthrough on what i did: I made a new js file container the code of my original button, but modified it to the event listener of the widget tinymce jQuery( document ).on( ‘tinymce-editor-setup’, function( event, editor ) { … Read more

Remove taxonomy widget from “PAGE” post

In your register_taxonomy() args, set meta_box_cb => false ‘meta_box_cb’ (bool|callable) Provide a callback function for the meta box display. If not set, post_categories_meta_box() is used for hierarchical taxonomies, and post_tags_meta_box() is used for non-hierarchical. If false, no meta box is shown. $args = array( //other args ‘meta_box_cb’ => false, ); register_taxonomy( $args );

Header Sidebar Won’t Move Lower – Want to Align with Header Logo [closed]

This is more of a css question, but here’s what i found looking at your site: This selector will control it: .site-header .widget { margin: 40px 0 0 0; } this is the code that has padding: <aside id=”dokna_product_search-2″ class=”widget widget_dokna_product_search”> Or if that doesn’t work try making it more specific: That box (col-md-8.col-sm-7.clearfix) has … Read more

How to dynamically add the the input text field in widget?

How about jQuery append method? To make a counter, simply increment i variable every click. $(‘body’).on(‘click’, ‘.add-more-button’, function() { var i = 2; $(‘.widget-input’).append(‘<label>Link’ + i + ‘</label><input>’); i++; } This is just an idea, I guess someone more experienced can develop it further.

Correctly Using checked function of WordPress

Now, based on your full code, there’s 3 problems: Line 60 of your code is missing a semi colon and throwing a fatal error. So: $instance[‘description_check_box’] = $new_instance[‘description_check_box’] Should be: $instance[‘description_check_box’] = $new_instance[‘description_check_box’]; On line 66, you’re using strings instead of proper boolean true or false values. Both if these are ‘truthy’ (see this answer … Read more

Select two value from meta key and post meta

You just need to join postmeta twice: global $wpdb, $bp; $user_id = get_current_user_id(); $query = $wpdb->prepare( “SELECT rel.post_id as id, rel2.meta_value as val FROM {$wpdb->posts} AS posts LEFT JOIN {$wpdb->postmeta} AS rel ON posts.ID = rel.post_id LEFT JOIN {$wpdb->postmeta} AS rel2 ON posts.ID = rel2.post_id WHERE posts.post_type=”books” AND posts.post_title LIKE ‘%%fire’ AND posts.post_status=”publish” AND rel.meta_key … Read more