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

Search results load individual post in slide out div

Since you wanted best-practices, methods, advice, here is my take on how you should proceed: First of all, divide the content of your page in two ideal spaces, the list of posts, and the content. Something like this: <nav class=”post-navigation”> <ul> <li> <h2>{Post title}</h2> <p>{Excerpt} [&hellip;]</p> <p><a href=”https://wordpress.stackexchange.com/questions/87312/{post-permalink}”>Read more &rarr;</a></p> </li> </ul> </nav> <section class=”post-content”></section> … 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 } ?>

best way to communicate between php and jquery/javascript

At first, you’ll have to make a dropdown filled with your values from the database: <select id=”pakket”> <?php foreach ($allPakkets as $pakket) { echo ‘<option value=”‘.$pakket[‘id’].'”>’.$pakket[‘name’].'</option>’; } ?> </select> And a div to put results in: <div id=”results”></div> Now, we add a piece of javascript: jQuery(‘#pakket’).change(function(){ // when the dropdown changes… var newvalue = jQuery(‘#pakket’).val(); … Read more

reorder a WP_Query, using a dropdown

I guess the problem is $qry = new WP_Query(array(‘category_name’=>$GLOBALS[‘city’],’order’=>$orderby)); Let’s just say $orderby is orderby=title&order=ASC Then the order argument of WP_Query will be like this: ‘order’=>’orderby=title&order=ASC’ However, order argument only accepts: ASC and DESC. You should do somethings like this: WP_Query(‘category_name=”.$GLOBALS[“city’].’&’.$orderby);

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

WordPress Theme – jQuery JavaScript Library Issue

Not entirely sure what you’re asking but you have to include and register scripts and then enqueue what you require like:- <?php wp_enqueue_script(‘jquery’); ?> (Place immediately before <?php wp_head(); ?>). Which is included with WordPress incidentally. You can read more on wp_enqueue_script for more information on how to use this in your theme. Edit An … Read more