Widget edit and add in any page

Search issue: You have label and br tags above search_keywords and search_location input fields. You can eater remove them in theme or set display: none; in css style for them. Css eg: .search_keywords label, .search_keywords br, .search_location label, .search_location br { display: none; } If you want to make map full width just like your … Read more

Are WordPress widgets cached?

Ok, seems that the problem is not related to the cache. But to the action execution order. If I update the value inside a page template (or inside a shortcode, that’s why I started my tests) the update fires after the render of the widget. Solution: update the value inside an action. In this example … Read more

Make a widget to my footer

Your theme appears to be loading its “footer” via code hooked into the wp_footer action, since there is no other obvious code that would do it. Of course, this is based on the limited code you have posted. This means that you should be able to remove and replace the footer code used by the … Read more

Adding link on title its in description but not in title see screenshots attached

I actually found a way around this , I moved the title inside the and that made it as a link as well , since I wanted it to have the same link anyways. <a title=”<?php _e( ‘View details’, ‘wolf’ ); ?>” class=”wolf-show-entry-link” href=”https://wordpress.stackexchange.com/questions/211020/<?php echo get_permalink( $post_id ); ?>”> Hope this could help some other … Read more

Where to add a widget class?

I copied the class definition and register_widget( ‘My_Widget’ ); to my theme’s functions.php file & it did show My Widget under Appearance > Widgets. So please place this code directly in your theme’s functions.php file. It is not recommended to edit anything in wp-includes directory.

How to add WooCommerce Add to Cart button in widget?

<?php /* Plugin Name: Keyframe Woocommerce Widget Description: Keyframe Woocommerce Add To Cart Sidebar Widget Author: Keyframe Version: 1.0 */ // Block direct requests if ( !defined(‘ABSPATH’) ) die(‘-1’); add_action( ‘widgets_init’, function(){ register_widget( ‘N_Widget’ ); }); /** * Adds N_Widget widget. */ class N_Widget extends WP_Widget { /** * Register widget with WordPress. */ function … Read more

retrieve custom post image through widget

Your calls to get_the_post_thumbnail do work, the problem is how what you’re doing with the result: <input type=”checkbox” name=”<?php echo $this->get_field_name( ‘photo’ ); ?>” value=”<?php echo esc_html(get_the_post_thumbnail( $post->ID, ‘thumbnail’ ) ) ?>” <?php checked( $instance[‘photo’], get_the_post_thumbnail( $post->ID, ‘thumbnail’ ) ); ?> > You can’t put image HTML tags inside of another tags attributes, that’s not … Read more

Widget to embed youtube video

In simple PHP,I am use this code : Url :have code that same as you genrate that appended at the end of url.I am work with core php. $url=”http://www.youtube.com/watch?v=fHBFvlQ3JGY”; preg_match( ‘/[\\?\\&]v=([^\\?\\&]+)/’, $url, $matches ); $id = $matches[1]; $width=”640″; $height=”385″; echo ‘<object width=”‘ . $width . ‘” height=”‘ . $height . ‘”><param name=”movie” value=”http://www.youtube.com/v/’ . $id … Read more