0
votes
0answers
33 views

Hide Password Protected pages in Recent posts

I have the following lines of code in my functions.php file: // Filter to hide protected posts function exclude_protected($where) { global $wpdb; return $where .= " AND ...
0
votes
1answer
42 views

Correct code to use php in text widget

This code is used to display php inside a text widget add_filter('widget_text','execute_php',100); function execute_php($html){ if(strpos($html,"<"."?php")!==false){ ...
0
votes
0answers
19 views

Search form is not working in live site

I have installed a wordpress theme called suffusion. Search widget is not working in this theme. It shows nothing found always. I have search.php as below. It is working in local machine <?php ...
-1
votes
1answer
24 views

What can I do to customize a widget provided with this plugin? from where have I to start?

I am using this WordPress plugin to create an immage gallery: http://wordpress.org/plugins/easy-media-gallery/ This plugin provide a single widget inside it and I would customize some litle function ...
1
vote
1answer
32 views

Displaying a variable stored in functions.php inside widget

I'm trying to display a variable that is stored inside my functions.php file - for the sake of the question this variable is stored as $test = 'test';. When i use echo $test inside page.php, ...
0
votes
1answer
35 views

Widgets not showing in my custom theme

I am developing this WordPress custom theme: http://onofri.org/WP_BootStrap and I am trying to insert a widget area under the Partner e Sostenitori section, but can't work. I have performed the ...
0
votes
1answer
43 views

Template from scratch: Sidebars not showing widget

I have an issue wherein i have a plugin (newsletter) which has a widget whereby users can (usually) subscribe to a newsletter and other functionality. But i digress. I have been trying to create ...
0
votes
1answer
27 views

Name Input from widget displays Sidebar name instead of saved data

I wasn't sure how to title this question,so I apologize. Let me first state that I have no experience with this type of code but I really need to this feature for my website, so I appreciate all the ...
1
vote
1answer
193 views

Create Image Uploader for Widget

I found this post// Use Media upload in custom widget on wordpress 3.5 I'm not experienced in any of this so I pretty much just copied the code he provided into my own functions.php file. I uploaded ...
0
votes
1answer
43 views

Wordpress - show number of comments for each post in widget

I have installed a plugin that lets me put a PHP code into the widget - basically, what I want to do is to create a "recent posts" area, where you can see a cover of the post (featured image's ...
0
votes
1answer
24 views

Using existing widget code! [closed]

Maybe this was answered many times but I couldn't find my answers so here I go: Am I allowed to use widgets php code from other existing themes and modify it for my needs?
0
votes
2answers
80 views

How to allow PHP In WordPress text widget

I want to add a text widget to my new WordPress website, but in the text widget there are some PHP snippets and I am finding it difficult to do it. Please help me Guys.
0
votes
1answer
83 views

display most popular tags in two columns

I have a section in my sidebar where I'd like to display my most popular tags in two columns. I found this post from WPSnipp that details how to narrow your list down to only the most popular, however ...
1
vote
1answer
76 views

Dashboard Widget Form

I created a Dashboard widget to send push notifications to an app, but the way I have it coded, whenever I make changes in the Plugin Editor and press Update File, the code gets ran and I get a blank ...
0
votes
1answer
26 views

Widget header unique classes

I have created the code below for one of my widget sections. Currently I am able to manipulate the title bar with (h3.home-widget-header) which is good. But obviously it will be for all widgets in ...
0
votes
1answer
69 views

conditional tags for the output of a plugin

I'm still quite a newbie developer so small problems like this bring me to a stand still from time to time. I've basically built a custom plugin to display pdf images next to a link very basic I ...
0
votes
1answer
32 views

Banner editable from backend

Im trying to create a widget area. Ive added this to the theme. <?php if ( dynamic_sidebar('myWidgetName') ) : else : endif; ?> And then i register the area with function ...
0
votes
1answer
125 views

My custom widget won't stay in the widget area after I refresh the widget page

As the title says, i've been developing a simple image rollover widget, now that I'm almost done, the widget won't stay in the sidebar areas after I drag and drop it in and refersh the page, any idea ...
0
votes
1answer
53 views

key( $GLOBALS['wp_registered_sidebars'] ) is always showing the same value

I am using this code from another answer add_action( 'dynamic_sidebar', 'wpse_96681_hr' ); function wpse_96681_hr( $widget ) { static $counter = 0; // right sidebar in Twenty Ten. Adjust ...
2
votes
1answer
684 views

How to include checkbox in widget backend form?

I'm trying to include a checkbox in my widget back end. But I cannot get the value (on or off) after the user submits it. I thought the value would be stored in "esc_attr( $check )" (as it is when ...
0
votes
2answers
84 views

Widgets in the loop if active

I'm trying to put a widget as "first post" if it's active.. and let the posts continue after that.. It works, but the first post disappears and the second post becomes the first in line after the ...
0
votes
1answer
82 views

Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin - Adding to “Thoughts” Theme

How do I enable infinite scroll (either with the infinite-scroll plugin OR the built in infinite scroll jetpack) on the "Thoughts" Wordpress theme? I'm a total noob at editing this stuff so if you ...
0
votes
0answers
29 views

Jetpack Top Posts writes differently when logged in and logged out

I added a line of code the top-posts.php file in Jetpack, in order to enable a sliding overlay on hover state. This works with the Top Posts widget in Image Grid view. It works perfectly while I am ...
0
votes
0answers
71 views

I need to shorten all titles to 12 characters followed by … in a widget (in the WP e-commerce widget)

Here's the php code I tried to modify, it's the widget file for Wp e-commerce "wpsc-cart_widget.php" <td colspan='2' class='product-name'><?php do_action ("wpsc_before_cart_widget_item_name" ...
0
votes
3answers
321 views

Custom Widget outputs the input but doesn't save anything inside the textarea

I've been working on my first widget, Everything works perfectly except it doesn't save anything I add to the textarea box. It will output the input on the website however. From research I think its ...
0
votes
2answers
67 views

random reason on refresh

I am editing the sidebar widgets and have added one for users who are not logged in or registered. the widget requests that users register or login and I am wanting to add a random reason (quote) as ...
0
votes
1answer
94 views

How to change links in the 3 main categories, on widget category, to a javascript function call

I'd like to know.. How could I change my 3 main categories links, so they call a javascript function? I'm using Snapshot Theme from WooThemes. Here's the current state of the website: ...
2
votes
1answer
68 views

nowplaying.include.php Will Not Display Results

Cyberchimps.com recommended I post here as they believed there may be a global issue with my request. I thought what I was missing was obvious and simple, but two months into this and being referred ...
0
votes
1answer
62 views

Add a select-option to the default widgets

I would like to add an extra feature to one of the default widgets so that the user can choose from the select-field to either align the widget to the left, center or to the right. How would I be ...
0
votes
1answer
52 views

Using a loop to build and update widgets

So I have a widget Im making which allows users to update 4 switches. Each switch has the same fields, name, description, price, amount so I decided to build the widget using a for loop instead of ...
2
votes
2answers
196 views

javaScript in <head> section of WP API

How do I place the following javaScript in the <head> section of the Wordpress Widgets API menu screen? <script type="text/javascript"> jQuery(window).load(function() { ...
0
votes
2answers
223 views

How to make widget title accept php?

I am trying to make widgets accept php, but without resorting to plugins. So far I have enabled php for the widget_text but cant make it work for widget_title. I am using the following code in ...
0
votes
1answer
34 views

Stuck with sidebar registering

I tried to add a custom page to my Wordpress template. That part is good. What I´m stuck with is a common sidebar that appears although I registered a custom sidebar for it. I am calling the ...
6
votes
2answers
528 views

What is the correct way to build a widget using OOP

I am working on a simple search form widget, with a built in autocomplete capability (You can download the current version here). The plugin is working, but I am currently rewriting all the code using ...
0
votes
2answers
257 views

Transform php code into a widget?

how can I create a widget out of a php code? It's just a disqus code that I would like to place in the sidebar. I could just paste the code in the widget section (my tag), but then I would not be ...
0
votes
1answer
249 views

Dynamic Sidebars & Echo

I can sucesfully get my dynamic sidebar to work like so: <div class="sidebar sidebar-first"> <ul class="widget-area first"> <?php dynamic_sidebar( 'pop-photos-sidebar' ); ...
0
votes
1answer
262 views

Call plugin with php function

This plugin only works as widget. I need call this plugin with php function. How to modify this code ? <?php /* Plugin Name: AJAX Calendar Plugin URI: ...
1
vote
3answers
502 views

Wordpress widget/sidebar dividers?

I have a widget sidebar, but I'd like dividers between them. I can achieve this in CSS using boring borders, but I have a png image I'd rather use instead. Is there a way to insert a divider after ...
0
votes
1answer
659 views

PHP Widget and do_shortcode

I'm using PHP Widget which allows PHP code to execute from a widget. I tried using this code to execute do_shortcode but it's not rendering <?php $lat = get_field('woo_maps_lat'); $long = ...
1
vote
1answer
199 views

Setting up widgets in wordpress with a unique ID for the after_title argument

I try to get the collapsible-widget-area plugin so that every widget it creates inside the collapsible area has a unique id <div> after its title. function get_args() { $this->args = ...
5
votes
1answer
1k views

How display widget by id

I fetched widget id this way: $the_sidebars = wp_get_sidebars_widgets(); print_r( $the_sidebars['sidebar-1'] ); It shows: Array ( [0] => recent-posts-2 [1] => recent-comments-2 [2] ...
0
votes
1answer
122 views

Edit the Publish Widget Options

Another noob question - under the 'Publish' widget in a default vanilla installation of WordPress 3.3.1, we would like to 'simplify' the Publish widget/ Specifically, we would like to have no 'draft' ...
-1
votes
2answers
1k views

How to add homepage Widget?

How do I add a 'Homepage' widget to my widget bar in Wordpress 3.3 ??!! EG: Dashboard > Widgets > Homepage with same fields as others
0
votes
2answers
454 views

Don't display a sidebar widget when on a specific page

I am trying to stop latest blog items from displaying in the blog section of my site. I have used the following code: <?php if ( is_page('blog') ) { ?> <h2>Don't display ...
4
votes
3answers
1k views

Has anyone managed to integrate the wp_editor inside a widget?

Adding this in the widget form method: wp_editor($text, $this->get_field_id('text')); seems to work. But after you press the "Save" button the widget goes funky... Adding ...
1
vote
1answer
319 views

If has $title in widgets

I'm writing a widget to display 125 x 125 pixel ads. There are 6 spaces for the ads and currently all works. However, I would to add some conditional logic so that if nothing is entered in the ...
0
votes
1answer
125 views

How to define template directory in this widget code

How can I define the template directory (So I can reference and image in the 'images' folder) from within this php widget code? // WIDGET CODE GOES HERE ...
0
votes
2answers
180 views

Modify pages widget and make a plugin?

I would like to make a plug-in that adds a widget. I would like it to be based on the current pages widget but add the ability to select either include OR exclude by drop down or checkbox then list ...
0
votes
1answer
118 views

Code in custom widget queries all posts, when it should only query the current post

I have a query in a custom widget (my first one!) which, if it's of custom post type book, retrieves the post ID. This then gets used in a WP_QUERY to retrieve data about the page. This works ...
0
votes
3answers
699 views

Style every second widget?

I need to apply a certain style to every second widget in my sidebar, and I'm reluctant to use :nth-child due to cross-browser compatibility issues. Is there a bit of PHP that will allow me to apply a ...