Articles of widgets

Widget for specific category

Hello every i am new to wordpress. I want to make my own widget which have a category selection option on backed and able to display posts from selected category on front.

Create Dashboard Widget with form to keep team's record

I am creating a wp site for a sports team. On the main dashboard, I want to create a simple widget that will allow the admins to update the team’s record. Then on a page template, I would like to echo out that content. I COULD add custom fields using ACF to the page editor […]

Need to know custom code to display random and most viewed posts in wordpress posts and pages

My focus is to use custom but an optimized code to display random and top posts/pages in my WordPress. I have seen some recommendations where people refer to plugins, but I need codes/query only.

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

I want to develop high quality themes by taking in to account all the important things like usability, accessibility. I just want my theme to be “perfect”. Here is my dilemma. So, what is best way to build a Home Page with a lot of sections? I know there are three possible ways. Widgets Page […]

Unable to get Alert function to consistently work with backend widget with latest WP

I have a back-end widget form that I developed as part as a word-press plugin. However, the alert boxes are not at all working and I am confused why. This is a default install of the latest WP with the standard theme that comes with a new installation. My widget is located at: http://codesupport.shalomisrael.org/wp-content/plugins/carousel_edit_url_for_newspro_201709181655.zip Please […]

Select two value from meta key and post meta

I want to ask best method to select two meta value from same column my code global $wpdb, $bp; $user_id = get_current_user_id(); $vlues=$wpdb->get_results(sprintf(” SELECT rel.post_id as id, rel.meta_value as val FROM {$wpdb->posts} AS posts LEFT JOIN {$wpdb->postmeta} AS rel ON posts.ID = rel.post_id WHERE posts.post_type = ‘books’ AND posts.post_title LIKE ‘%%fire’ AND posts.post_status = ‘publish’ […]

strange shortcode error: does shortcodes requires any dependency?

Are there any dependencies on which shortcode depends? [news_weber][/news_weber] → Didn’t work, but when used with do_shortcode method it worked. I installed Ultimate shortcode plugin to check whether that works or not. all the shortcodes of that plugin worked, strangely as soon as that plugin was installed my custom shortcodes also worked and as soon […]

All custom widgets are not showing in widget area at the same time

I have created 3 custom widgets named Prakash Category Widget, Prakash Author Widget and Prakash Tag Widget. Their codes are: <?php // Begin Prakash Category Widget /* Plugin Name: Prakash Category Widget Description: A Simple Category Widget Version: 1.0 Author: Prakash Pazhanisamy Author URI: http://prakashpazhanisamy.wordpress.com */ class CategoryWidget extends WP_Widget { public function __construct() { […]

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

I have made a widget with input fields. I want to make an add more button to dynamically add the input field the first input field is the default. How can I make it is it possible to do that? Here is my widget code : <?php class ExampleClasss extends WP_Widget { function __construct() { […]

Trying to filter tag cloud args, but it removes the wrapper

I’m trying to reset the font size for tag cloud by using the widget_tag_cloud_args filter as follows: add_filter( ‘widget_tag_cloud_args’, ‘filter_tag_cloud_widget’ ); function filter_tag_cloud_widget() { $args = array( ‘smallest’ => 16, ‘largest’ => 16, ‘unit’ => ‘px’ ); return $args; } This should set the font size for all the tags to 16px. The code does […]