Widgets Opening In New Window – Unwanted

Your image links have the target=”_blank” attribute so that’s why they open in a new window. If you haven’t checked the open in new window checkbox, you can always add a text widget and add those images manually like Text to make sure no ‘target’ attribute is being written.

how to run a php code in widget?

Try this with or without the return. $object_terms = wp_get_object_terms($GLOBALS[‘post’]->ID, ‘staff’, array(‘fields’ => ‘all’)); if ($object_terms) { echo ‘<p>’ . ” . ” ; $res=””; foreach ($object_terms as $term) { $res .= ‘<a href=”‘ . esc_attr(get_term_link($term, $taxonomy)) . ‘” title=”‘ . sprintf(__(“View artiles of: %s”), $term->name) . ‘” ‘ . ‘>’ . $term->name . ‘</a>, … Read more

Even with PHP plugin get_posts not working in widget area

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=”https://wordpress.stackexchange.com/questions/196622/<?php the_field(“headshot’); ?>”> <?php } ?> </ul> </div>

Nonce and widget

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 … Read more

Adding a trinket.io widget to a post

Trinket.io founder here. We embed trinkets in our WordPress blog (blog.trinket.io) all the time, which is hosted by WPEngine (wpengine.com). One solution is to use a hosting provider like WPEngine that works out of the box. I have to imagine that many of the excellent independent hosing providers out there support iframe embeds out of … Read more