Articles of widgets

How to add custom tinymce plugin to new text widget

So I have a custom TinyMCE plugin, which adds a button to the editor. I’m using the mce_external_plugins and mce_buttons filter to add my TinyMCE plugin. After WP 4.8 introduced the simple TinyMCE for the new text widget i would like to include my button i that editor as well. For some reason i can’t […]

Widget's Content Mssing in Child Theme

After creating Child Theme with just style.css and functions.php, my content in widgets won’t show up in child theme. To clarify what I mean under ‘Content in Widgets’, lets take for example Footer Area Widget: If I write some text or HTML in widget, it won’t show up in child theme. Also, for some other […]

Correctly Using checked function of WordPress

In the Public Function Update this code is sitting → `public function update($new_instance, $old_instance) $instance[‘description_box’] = $new_instance[‘description_box’]; In the public function widget, this code is sitting → public function widget($args, $instance) { $description_box = $instance[ ‘description_box’ ] ? ‘true’ : ‘false’; In the public function→ public function form( $instance ) { This code is sitting […]

WordPress database error – quick review

This error appears when I try to activate one option in widget. I broke it in multiple lines so it may be easier to review. I hope it should be very quick to fix code for someone who is familiar with SQL. I appreciate your time! WordPress database error: [You have an error in your […]

Passing user enetered value in widget: number of words, for example

<a href=”<?php the_permalink(); ?>”> <?php the_title(); ?></a> The above is the code snippet from one of the widgets of my theme. Now in the widget arrangement, this is the situation → $instance[‘number_of_words’] = absint( $new_instance[‘number_of_words’] ); the above setting is to handle how many numbers of words do we wish to show in the title? […]

Removing default theme widgets

I am trying to remove the default widgets in a theme that I found here: The theme is Terapathy. In case of some of the most used themes, if I select the custom widgets, the default theme widgets disappear. But with Terapathy theme or any of the themes found in that site it is […]

Different widgets in sidebar on sub-children pages?

I’m working on project, where I have different widgets on pages and also different order. Example – on About page I may have chat widget, then e-mail sign-up widget, then testimonials widget. On other page I may have testimonials widget only, followed by chat widget. I’m using this code to show widgets on pages and […]

How do I use add_action on custom widget?

First hope you will take a look example widget There have male and female option. Let say I select male and I want add male.css to wp_head When I put something like this into the code it’s not working. add_action(‘wp_head’,’load_face’); function load_face() { wp_enqueue_style(‘style’, WP_PLUGIN_URL . ‘/sample/’.$sex.’.css’, null, null, ‘screen’); } Let me know […]

Display posts from category in post content?

I am developing a website using WordPress. As I don’t want the sidebar, I removed ‘get_sidebar()’ from my page. But I need to place a category in the content part (like a category for latest news) – not in a sidebar. How could I do this?

Button in SideBarOther widget not showing up on all pages

An item in SideBarOther shows up on the main article listing page, but when I select an article (same page layout, the article replaces the listing), the item isn’t there. There are two items in SideBarOther, and only the 2nd one has this problem (see code below). If I remove the first one, it is […]