Simple SCript Not Displayed in WIdth

You maybe need to enqueue the js file after jQuery or any other library. It also depends on how you want to implement this (with your theme or plugin), but it’s another question. You need to read more about wp_enqueue_scripts action to register and enqueue in the right way and see into Discord manual to … Read more

Widget Update problems using a for loop

Please replace below line: echo “<input class=”widefat” type=”text” value=”{$instSpecLine}” name=”{$instSpecLine}” id='{$instSpecLine}’ placeholder=”Spalte {$j}” >”; With Below code: echo “<input class=”widefat” type=”text” value=”{$instSpecLine}” name=””.$this->get_field_name(“spec_line_{$i}_{$j}”).”” id='{$instSpecLine}’ placeholder=”Spalte {$j}” >”; Hope this will help you

How to get sidebar widgets in leftsidebar template

In your sidebar.php or any other custom sidebar file call by ID like this <?php get_sidebar(‘sidebar-widget-1’); ?> Not like this <?php get_sidebar(‘Sidebar Widget 1’); ?> See the difference, I used ID in get_sidebar() function instead of name. Now where ever you want sidebar appear in front-end, there call it like this <?php get_sidebar(‘sidebar-widget-1’); ?>

Add Control in Widgets Sub-Panel in Customizer

Turns out the section would be addressed with ‘section’ => ‘sidebar-widgets-top-widget-area’ … so you need the sidebar-widgets- in front of the widget area name. However, since it is the widgets panel, everything except the widget areas active on the page your are at are set to display: none; and need to be set to: display: … Read more

Apply two different styles to Wiget Titles along with a decorative line

This will wrap a span around the first word and also the remaining words in the title. Adjust the class names as necessary: add_filter(‘widget_title’, ‘yourprefix_custom_title’); function yourprefix_custom_title( $old_title ) { $title = explode( ” “, $old_title, 2 ); if ( isset( $title[0] ) && isset( $title[1] ) ) { $new_title = “<span class=”first”>$title[0]</span> <span class=”second”>$title[1]</span>”; … Read more

Force update widget customizer using js

Widgets in core presently do not make this easy. Please read Live Widget Previews: Widget Management in the Customizer in WordPress 3.9, and in particular the section “No more Update button (usually)”: Widget forms on the admin page have a familiar Save button. In previous versions of Widget Customizer, we adapted the Save button to … Read more

wp_enqueue_media(); in multiple widgets

Your actual issue is that you are using $(‘.custom_media_url’).val(attachment.url); without selecting the exact field you need. This selects every .custom_media_url field on the page, e.g. each field within each widget. Since you are using jQuery, you can replace this line: $(‘.custom_media_url’).val(attachment.url); with $( e.target ).siblings( ‘.custom_media_url’ ).val( attachment.url ) However, using wp.media.editor is not the … Read more

Add disclaimer before certain posts and pages

Is there a better way to accomplish this using the affiliate tags on my posts? Definitely I would go for an easier option, not relying on plugins like Jetpack. Why don’t you try the has_tag function? Something like this: function tt_filter_the_content( $content ) { if (has_tag(‘affiliate’)) $custom_content=”YOUR MESSAGE”; $custom_content .= $content; return $custom_content; } add_filter( … Read more