Articles of widgets

instance is empty in function widget()

I am working on a widget for my theme. If I do a print_r($insance) in the form function, the instance array is populated with the correct data. I have checked the database and the correct information is there in the options table for my widget. My problem is that, if I do a print_r($instance) for […]

How to run PHP code in Text Widget with no plugin in WP 4.4

Before I had the following code in the function.php add_filter(‘widget_text’,’execute_php’,100); function execute_php($html){ if(strpos($html,”<“.”?php”)!==false){ ob_start(); eval(“?”.”>”.$html); $html=ob_get_contents(); ob_end_clean(); } return $html; } Then I have updated WP to the version 4.4.1 and now it’s not working anymore. Is there any other solution?

Display the id list of active widgets of same sidebar?

The condition is i have to check the id of active widgets of one sidebar and hide some widgets based on id of the listed widgets.Any ideas …

Text Widget creates a <li>

I’ve got a basic text widget and, outside the standard <div class=”textwidget”> wrapper there is a <li id=”text-5″ class=”widget widget_text”> (which I have not added when creating the sidebar in functions.php or added when adding a text widget from the dashboard). i.e. the full code looks like this: <li id=”text-5″ class=”widget widget_text”> <div class=”textwidget”> <my […]

How to retrive widget title/data

I’m using this code to display widgets of certain sidebar: $sidebar_id = ‘sidebar1’; $sidebars_widgets = wp_get_sidebars_widgets(); $widget_ids = $sidebars_widgets[$sidebar_id]; foreach( $widget_ids as $id ) { echo ‘<li><a href=”#’.$id.'”>’.$id[‘title’].'</a></li>’; } I’m trying to display the widget title using $id[‘title’], but It’s not working.

WordPress Plugins won't save

I have a WordPress website I just took over for a client so I don’t have the ability to talk with the previous webmaster / the developer. The site is using a slightly modified version of the Subway by YOOtheme. To update the plugin location, there is a part of Subway that has “Widget Options”. […]

Custom Widget Creating PHP Exception When Placed In Its Own PHP File

I have a custom plugin created and i have created a widget. At the moment this code is included in the base php file for the plugin and its working fine. I want to move the widget and all future ones into a widgets.php file and include them into the main plugin file. When i […]

Embedded Videos (PB) – Not Available

I am using this link to create a wordpress website VIDEO At minute 53 the guy is using “Embedded Videos (PB)” widget in order to embedd a youtube video. (By the way he is using Page Builder). Problem is – that widget is not available in the wordpress. Where can I find it, or is […]

Display assigned terms with link

I want to display product assigned terms, wrapped in link/anchor MarkUp, in my sidebar on a page as a widget. I am not getting the correct tag URL. Code returns visited product URL instead of listed tags URL. Here is the problematic part of the code. What is the correct use of get_the_terms()? $custom_terms = […]

Text Widget Links Not Working

I am trying to add a simple link to an ‘About’ page in a Sidebar Text Widget but when I test it the link does not work and I get an error on the linked page: “The page cannot be displayed because an internal server error has occurred.” I know the link works because if […]