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

change the icon of a custom post type in WordPress to use twitter boostrap

I always like using this tutorial which would give you this code. <?php add_action( ‘admin_head’, ‘cpt_icons’ ); function cpt_icons() { ?> <style type=”text/css” media=”screen”> #menu-posts-POSTTYPE .wp-menu-image { background: url(<?php bloginfo(‘template_url’) ?>/images/YOURIMAGE.png) no-repeat 6px -17px !important; } #menu-posts-POSTTYPE:hover .wp-menu-image, #menu-posts-POSTTYPE.wp-has-current-submenu .wp-menu-image { background-position:6px 7px!important; } </style> <?php } ?>

Javascript block in Twenty Twelve theme

By default when you use wp_enqueue_script the script is inserted into the <head> section. This is usually set in functions.php. The argument also has a footer option called $in_footer, if you set this to true, the scripts will instead be added to the footer section. In TwentyTwelve there are several calls to wp_enqueue_script with footer … Read more

Create a short code that inserts js

Put the script into an external file, set the selector there and enqueue it from your shortcode: if(! function_exists (‘aisis_toc’) ) { function aisis_toc() { if ( ! is_singular() ) return; wp_enqueue_script( ‘jquery-toc’, plugins_url( ‘js/jquery-toc.js’, __FILE__ ), array ( ‘jquery’ ), NULL, TRUE); return; } }