New answers tagged

0

As I'm not able to comment yet, I can only answer. But I've got questions. How does the widget get used? Where is it called? is the ORIGINAL script you posted above in a file like /theme/twitter-widget.php? Or is it in your functions.php script for the theme? Something wasn't configured to run YOUR widget, and WordPress is still using the original.


-1

Had a similar problem - from what I've read on Timely site, widget is only designed for use on external sites and causes conflicts on pages also displaying the calendar. Shame, but can't see a workaround.


0

The existing answer here is excellent, but unfortunately due to the answer's age it does not work for newer versions of WordPress. The code below improves in two ways: 1 - It's the recommended / best practice method for newer versions of WordPress, as of version 2.8 2 - It allows you to select the taxonomy through the dashboard widget interface, rather ...


0

Not really following how the functions relate to each other and where (so what variables are available, how), but you might try something like: add_action('before_test_action', array($this, 'widget_test_func')); public function widget_test_func( $instance) { $boolean = (isset($instance['boolean'])) ? $instance['boolean'] : ''; if ($boolean == 'on'...


0

I think ajax request should point to the actual WordPress ajax handler. You can pass the variable by localising the script: $js_object = [ 'ajaxUrl' => admin_url('admin-ajax.php') ]; wp_register_script('my-script', 'http://url'); wp_localize_script('my-script', 'pluginObject', $js_object); wp_enqueue_script('my-script'); Register the ajax ...


1

SOLUTION: So, it turned out (of course) I myself was causing the problem (...) I am getting the widgets with the 'the_widget()' method and sending the instance params along as I go. The params are query-string-style parameters and are of course 'glued' together with ampersands. Now , I wasn't encoding the individual params so the query string was looking ...


2

This can become a quite an expensive operation which can seriously damage page load time. At this stage, your code is quite expensive. Lets look a better way to tackle this issue. What we need to do is to minimize the time spend in db, and to do this, we will only get the info we need, that is the post_author property of the post object. As we now, there is ...


0

<?php if( is_category() ) { global $wp_query; $term_obj = $wp_query->get_queried_object(); $author_array = array(); $args = array( 'posts_per_page' => -1, 'category' => $term_obj->term_id, 'orderby' => 'author', 'order' => 'ASC' ); // Get the posts in the ...


0

There's a lot of reasons this isn't working. The best place to to start is the Widgets API page in the Codex. It outlines a basic class for creating a widget. At a minimum, you need a class with a __construct(), widget(), form(), and update() function. You also need to register your widget correctly. The register_widget() function takes the class of the ...


0

First you should be able to write php code in widget. The normal Text widget allows you to insert arbitrary Text and/or HTML code only. There are many plugins which gives you that facility. I checked the following wordpress plugin. https://wordpress.org/plugins/php-code-widget - install and enable plugin. Change the code as per your requirement and paste ...


0

In the function that you're hooking into user_register, you need to create the user and save the values. First, I'd recommend using wp_insert_user() instead of wp_create_user(). You might do something like this: $userdata = array( 'user_email' => $email_address, 'user_login' => $user_name, // this is automatically salted 'user_pass' ...



Top 50 recent answers are included