Tag Info

New answers tagged

0

The normal practice is to generate URL on PHP side ( admin_url() ) and provide it to your script via localization functionality ( wp_localize_script() ). It is documented in Codex under Ajax on the Viewer-Facing Side.


0

Looking though the existing plugins, the standard tinymce way to do this is to save the popup window in a win variable: { text: 'VĂ­deos', onclick: function() { var win = editor.windowManager.open({ //etc And then use win.find('#name') to target the control, eg: {type: 'listbox', name: 'video_site', onselect: function( ) ...


1

The primary reason we use enqueue scrips is because WordPress will properly manage all the requests. For example, if two different plugins are using a certain third party library, WordPress will make sure that the script is only loaded once. It will also do a good job of handeling multiple version of the same script. Lastly, you will also be able to ...


0

Use that JQuery code from your question in customizer preview for real time update. Your transport should be set to 'postMessage'. In your website you can add body class in function.php: function theme_prefix_body_class( $classes ) { if ( get_theme_mod('header_fixed', 0 ) == true ) { $classes[] = 'fixed-header'; } return ...


0

i think you're putting too many extra bits on the file and path strings. try this : function _s_scripts() { $js_dir = get_template_directory_uri() . "/js/"; foreach(glob($js_dir.'*.*') as $file) { $label = str_replace(".", "", $file); wp_enqueue_script($label, $file , array('jquery'), '1.0.0'); } } add_action( 'wp_enqueue_scripts', '_s_scripts' ); when ...


0

It looks like it can be a selector issue. Try making your selector more specific for the widget in the sidebars: Something like : $('#widgets-right #widget-so_calendar_excerpt-range_from') could work. But, if you create a second instance of the widget, it can break again, because of the multiple same ids.


0

I suggest going with a slider plugin like Layer Slider or this http://www.wonderplugin.com/wordpress-slider/ . You're right that a plugin search for this kind of topic has the potential to be endless, so look for customizability and extendability in the plugin. Similarly for going the DIY route. There's no need to reinvent the wheel. Find a strong jQuery ...


0

Thanks to CSS Tricks, I changed the existing SmoothScroll code that came with the site to the following which worked: $(function() { $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { var target = $(this.hash); target = ...


1

You should use the pre_get_posts filter for this. For example, you could do this in your theme's functions.php file: function limit_category_posts( $query ) { if ( $query->is_archive() ) { // Do not do this for the date or category archives. if ( $query->is_date() || $query->is_category() ) return $query; ...


0

I don't have enough reputation to reply to comment on your answer, so I will post it here: I had similar problem, and answer why class selector works (and id don't) is because on widgets page, that element appears twice (on left side to select it and drag to the right), and on the right side, in appropriate sidebar area. So, that element and everything in it ...


0

Lazy Load really does not require no coding, you can use the Lazy Load plugin (just activate it). I also suggest providing different thumbnail sizes on the basis of the required dimension for the position (and you could even deliver them differently on the basis of the screen size, if you wish, to allow rensponsive themes work well). Other ideas can be ...



Top 50 recent answers are included