if is_home(), change class of menu-item-225 of wp_nav_menu

Rather than adding a class, just add a second selector to your .current_menu_item style of .home .menu-item-225. Not ideal, but for a single case, I think it’s completely appropriate. (This assumes that you’re using body_class() on your <body> element, but you should be doing that anyway.)

wp_register_script Question

If you need to add it in the head, then this might help you: <?php add_action(‘wp_head’, ‘add_attr’); function add_attr(){ ?> <script data-cfasync=”false” type=”text/javascript” src=”http://use.typekit.com/YOUR-KIT-ID.js”></script> <script data-cfasync=”false” type=”text/javascript”>try{Typekit.load();}catch(e){}</script> <?php } ?> Make sure your theme has the wp_head function call. You’ll need wp_enqueue_scripts or wp_register_scripts only if your JS code in in some other .js file … Read more

Trying to get fittext to work in WordPress

I figured it out finally, for some reason using the $ in my script just doesnt work so I had to use jQuery instead like this <script type=”text/javascript”> jQuery(document).ready(function() { jQuery(“#fittext3”).fitText(1.8, { minFontSize: ’12px’, maxFontSize: ’75px’ }); }); </script>

WordPress video end function [duplicate]

You can track the state of the youtube video, do you have the link to the youtube video? Use this youtube API function to get the result, and if it hits you back with a “0” you can initiate the alert(); function player.getPlayerState():Number Returns the state of the player. Possible values are unstarted (-1), ended … Read more

custom page url slug needs illegal ?id=1 for javascript

Here’s a potential solution using the page_link filter and testing for the presence of a meta key to add a query arg: function wpa84303_page_query_arg( $permalink, $page, $sample ) { if( $query_arg = get_post_meta( $page, ‘query_arg’, true ) ) $permalink = add_query_arg( ‘id’, ‘0’, $permalink ); return $permalink; } add_filter( ‘page_link’, ‘wpa84303_page_query_arg’, 10, 3 ); Add … Read more