Tag Info

New answers tagged

0

Widget CSS Classes is probably your best friend. It has the ability to add CSS classes manually by just typing them in, or you can set up predefined items that will add classes automatically. It's quite handy.


0

WordPress is giving you a notice that this construct is deprecated, because it is preparing for PHP7. You should check your custom code and any plug-ins for the use of the WP_Widget construct. There are (still) a lot of plug-ins that need to update their code. Here is a list of plug-ins that use the deprecated WP_Widget construct: ...


1

This is a bug in WordPress 4.3. The authors have made the necessary revisions to core and it will be fixed in WordPress 4.3.1. In the meantime, you can patch your version of WordPress. The details are here: https://core.trac.wordpress.org/ticket/33442


0

If you want to keep WP_DEBUG on and do you want to hide this specific type of error, put in your theme functions.php this line: add_filter('deprecated_constructor_trigger_error', '__return_false'); This will prevent this kind of error to be displayed. I hope it helps :)


6

The first location where PHP would look for relative path will not be the file you specify include in, but relative to point of entry file (index.php or whatever). Files are included based on the file path given or, if none is given, the include_path specified. If the file isn't found in the include_path, include will finally check in the calling ...


-1

Wordpress Debug mode can produce these kinds of messages. I had the same problem on one of my sites. Maybe you have this line of code on your wp-config.php file: define('WP_DEBUG', true); Try changing it to: define('WP_DEBUG', false); Hope it helps.


0

You have to be more clear about your problem. It will be better to publish you code and anyone can check it a give their help. I have created a contact form before with nonce and inside the form i added: <input type="hidden" name="nonce" value="<?php echo wp_create_nonce('send_email_nonce'); ?>"/> and on the on the form handler i added: ...


0

Perhaps this approach will work for you. I like to use PHP Code Widget, which is like a regular Text widget, but one that allows you to use Wordpress functions and other PHP in the body. Once you install that widget you could then use one of the Wordpress functions like get_page_link() or get_permalink() to dynamically retrieve the page link that you are ...


1

There are 2 problems here ( and a third unrelated problem ) Problem 1 You're calling register_widgetArea, a function that doesn't exist. Instead, you want to register a sidebar. If no sidebars are registered, the widgets menu does not appear in the admin area. Instead, use register_sidebar to register your sidebar. I would expect calling ...


0

You dont have to make a post type Contact.Just make a dynamic sidebar in the Widget area of Wordpress.And take the Text Widget in that Dynamic Sidebar , Copy your html and Paste it there in the Dynamic Widget Area you make. If you are not able to make the Dynamc sidebar Paste ths code in you functon.php register_sidebar( array( 'name' => ...


0

Lets try with below code function sidebar_widget_init() { global $_wp_sidebars_widgets; if ( empty( $_wp_sidebars_widgets ) ) : $_wp_sidebars_widgets = get_option( 'sidebars_widgets', array() ); endif; $sidebars_widgets_count = $_wp_sidebars_widgets; $sidebar_count = count( $sidebars_widgets_count[ ...


3

The error isn't actually caused by your PHP version (PHP 4 constructors won't be removed until PHP 7) - it's a warning produced by WordPress in preparation for this. Each repetition of the error represents a plugin using the outdated code. Until your plugins' authors update them, you can run the following shell command on a Linux system to find the old ...


0

I was in a similar boat (first had to fix some custom widgets in a theme), but had the message even after fixing them. Switched to a default theme: still had the same error. TL;DR: Started deactivating plugins one-by-one... found https://wordpress.org/plugins/list-category-posts/ was the culprit.


0

1) If you want to perform certain operation as a first activity after the save button click, then you would have achieved it via server side script (here PHP) by hooking into some action, but as you are clearly specifying that you want client side action only, I think there is no straightforward way to control the order of the even like click. However, one ...


1

See the WordPress Codex page on Widgets API and utilize the update() function in your widget class declaration as used here and add a script call in the appropriate place: /** * Processing widget options on save * * @param array $new_instance The new options * @param array $old_instance The previous options */ public function update( $new_instance, ...


4

You need to listen for the click event (there is no such thing as a pre/before click) and do some work right then or figure out if you want to allow the click to "go through" or not based on some validation for example. jQuery(function($) { // We are binding to the body so that the code // will work for future elements added to the DOM ...


0

Firstly, it is not recommended to use WP_PLUGIN_URL constant, instead use plugins_url() function. Second thing, it will not work when you put your files in the theme. You must put the necessary folder and file in the plugin if have to use this constant or function. Make sure, you have put correct path and you JS file is being loaded properly. ...


0

Inside the widget ensure a unique name for the submit button: <button type="submit" name="widget_submit">Submit</button> In functions.php: function wpse20150815_processing_widget() { if( !isset( $_POST['widget_submit'] ) ) return; //set an array for storing errors $errors = array(); //process form data, and store errors ...


0

If you are doing this via Ajax then after getting the response, you can redirect via JavaScript window.location.href = 'url to be redirected to';


0

The syntax is not 'post-type' or 'post-status', it is with an underscore instead of a dash: 'post_type' => 'testimonials', 'post_status' => 'publish',


1

Looks like they are hard-coded into the sidebar. So you could manually remove them, but they'll just return when you update the theme. Best solution would be to make a child theme, if possible, and create a new sidebar without the unwanted widgets. EDIT: Remove <aside id="archives" class="widget"> <h1 class="widget-title"><?php ...


0

I assume that you want to add more custom fields in widget back end form, for this you just need to create a new field in form( $instance ); function. So the code will look like // Widget Backend public function form( $instance ) { if ( isset( $instance[ 'title' ] ) ) { $title = $instance[ 'title' ]; ...


0

Protip: Double check your uploads paths before spending hours trying to find a bug. 'wp-content/plugin', incidentally, is not the correct upload path.


1

The problem is your update function. $old_instance is kind of special variable. The simplest is function update($new_instance, $old_instance) { return $new_instance; } For the safe function update($new_instance, $old_instance) { $instance = array(); $instance['name'] = htmlentities($new_instance['name']); ...


0

Tuns out it needed: global $post Complete working code: <div class="aboutgridcont"> <ul class="about-us-grid"> <li> <?php global $post; $posts = get_posts('post_type=employee&orderby=rand&numberposts=16'); foreach($posts as $post) { ?> <img class="headshot" src="<?php the_field('headshot'); ?>"> <?php ...



Top 50 recent answers are included