Tagged Questions
0
votes
1answer
36 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
25 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
24 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
0answers
55 views
Custom “Latest News” widget wipes out the site
I want to register a custom "Latest News" widget, which would be teh exact copy of the default "Recent Posts" widget, with minor modifications.
Here's the original code, taken from the ...
0
votes
1answer
21 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 ...
-1
votes
0answers
39 views
Is it possible to dynamically add widget areas?
I am creating a very custom and unique theme that uses posts as sections for the front page. The posts all have a configured style to them, so I am wondering if it is possible to dynamically create ...
0
votes
0answers
36 views
PHP script working in PHP page but not PHP widget [closed]
I have this code :
<html>
<form method="post" action="">
<div align="center">
<p><b> What to see if the server is online rite now just add the server Address and Port ...
2
votes
2answers
111 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
0answers
17 views
Sidebar If Query
I have this query which I'm using in the sidebar, but when I place it in a php widget, the whole sidebar disappears... Any ideas?
global $wp_query;
$postid = $wp_query->post->ID;
if ( ! empty( ...
0
votes
2answers
53 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
28 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 ...
5
votes
2answers
208 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
74 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
85 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
159 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
257 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
332 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
130 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
525 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
80 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
723 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
236 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
872 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
237 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
79 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
116 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
101 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
446 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 ...
10
votes
1answer
297 views
Limit the number of inactive widgets
I'm trying to restrict the number of widgets from the "wp_inactive_widgets" sidebar to maximum 10, because the widgets admin page is incredibly slow:
add_filter('pre_update_option_sidebars_widgets', ...
1
vote
1answer
517 views
How do I create a drop down menu in a widget?
How do I create a simple dropdown menu with 3 options in a widget?
I'm using $instance to do it. How would it look in a barebones widget?
2
votes
1answer
208 views
Anything I can add to functions.php to make text widgets accept PHP?
Is there a way I can make text widgets accept PHP? Perhaps something I can add in to functions.php? I'm redesigning my site, and I was wondering why I didn't use widgets at all in my current design, ...
3
votes
1answer
736 views
Get the sidebar ID in which the current widget was dropped
How can I find out in which sidebar was a widget dropped? From inside that widget. More precisely from the form() function.
Can I automatically remove the widget if it's not added in the appropriate ...
2
votes
1answer
238 views
Count widgets of a certain type
How can I get the number (count) of, let's say, text widgets from a sidebar?
for eg. if I drop 4 text widgets in the sidebar, I want to get this number somehow from another widget
1
vote
1answer
939 views
Missing argument 3 for wp_register_sidebar_widget()
I installed the Deprecated Calls plugin and it's telling me to change register_sidebar_widget() and register_widget_control(), essentially add wp_ first.
I did but I'm getting Missing argument 3 for ...
0
votes
1answer
175 views
Missing sidebar parameter “fix” - before_content
as you know the sidebar parameters from register_sidebar() that control the widget layout are
- before_widget
- after_widget
- before_title
- after_title
the problem is that you cannot implement ...
1
vote
1answer
432 views
Widget Javascript code (ajax)
I have a widget like this:
class test_widget extends WP_Widget{
function test_widget(){
$widget_ops = array('description' => 'test widget');
$this->WP_Widget(false, 'Test', ...

