camdoughcat
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Hueman] menu doesn't show submenu (doesn't collapse)I checked his on ipad, works ok and shows main menu and sub-menu items.
Maybe he is referring to the mobile menu view being fully expanded (not collapsed) when you click on the icon. Same issue I have with one of my sites as well when on mobile view.
The menu/sub-menus are there but they are all fully expanded by default rather than just the main menu items.
function pages_in_home_loop( $query ) { if ( is_home() && $query->is_main_query() ) $query->set( 'post_type', array( 'post', 'page') ); return $query; } add_filter( 'pre_get_posts', 'pages_in_home_loop' );Put that in your (ideally) child-theme’s functions.php file
Forum: Plugins
In reply to: [WP Product Review Lite] style, scripts only on actual page / post-pagesYou can at least load the scripts/stylesheets in the footer:
In /wp-product-review/wp-product-review.php
change line 426:
add_action('wp_head', 'cwppos_pac_print');to
add_action('wp_footer', 'cwppos_pac_print');@ JW Player
Probably asking a bit much but ‘when’ do you think that might be?
Forgot to mention, make sure you have ‘Dynamic Styles’ turned off in the Options Tree settings
Put this in your child theme’s functions.php file:
function my_google_styles() { wp_register_style('googlefonts', 'http://fonts.googleapis.com/css?family=Roboto:400,400italic,500,700,900', array(), null ); wp_enqueue_style( 'googlefonts'); } add_action('wp_enqueue_scripts', 'my_google_styles');Then in your child theme’s style.css file you would use:
body { font-family: "Roboto", Arial, sans-serif; }Actually I switched that funcion out and replaced with the following snippet in my child-theme’s funcions.php file. This prevents any JW scripts being loaded except for on single posts and pages – which is the only place on my blog that uses the player.
//ALLOW JW PLAYER SCRIPT LOAD IN POSTS AND PAGES ONLY function remove_jw_print() { if ( (!is_single()) || ( !is_singular() ) ){ remove_action('wp_enqueue_scripts', array('JWP6_Plugin', 'insert_javascript')); remove_action('wp_head', array('JWP6_Plugin', 'insert_license_key')); remove_action('wp_head', array('JWP6_Plugin', 'insert_jwp6_load_event')); wp_dequeue_script('jwplayer', JWP6_Plugin::player_url()); } } add_action ( 'wp_head','remove_jw_print', 3 );@tomasdev
Thanks for that snippet, I put that in my child-theme’s funcions.php file and it does indeed remove the jwplayer script files wherever there is not a shortcode in use with the exception of the Home page of my blog – there is still the reference to the cdn-hosted js file in the head. Any ideas?No shortcodes are in use on the home page.
@southcast – Thanks again – you’re awesome!
@Longtail Video – yeah you already have the ability to disable the shortcodes on certain pages within the plugin settings right…..so hopefully just an addition to disable loading the js files when they are not needed will be easy to implement.Thanks for sharing the code – exactly what I needed as well. However does anyone know the correct conditionals to use if I want the jwplayer to load ONLY on single posts and pages? I do not want the jwplayer.js, etc. loading on home, tag, ctegory, archive pages, etc. ???
I agree 100%. I usually deregister all the useless js that I do not use and older versions of Nextgen this could easily be done but now cannot. Page load time on nearly every one of my sites has gone way up in Google Page Speed and this is even with using a cache plugin (W3TC).
Think I am going back to Nextgen 1.9.3