Calling external Libraries in WordPress

In your functions.php add this code function load_custom_script() { wp_deregister_script(‘jquery’); wp_register_script(‘jquery’, ‘https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js’, false, ‘1.6.2’); wp_enqueue_script(‘jquery’); wp_register_script(‘jquery.flexslider’, get_bloginfo(‘template_directory’).’/jquery.flexslider-min.js’, array(‘jquery’)); wp_enqueue_script(‘jquery.flexslider’); } function load_custom_style() { wp_register_style(‘flexslider’, get_bloginfo(‘template_url’).’/flexslider.css’, array(), ”); wp_enqueue_style(‘flexslider’); } add_action(‘wp_print_scripts’, ‘load_custom_script’); add_action(‘wp_print_styles’, ‘load_custom_style’); Do not forget to remove your code <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js”></script> <link rel=”stylesheet” href=”<?php echo get_bloginfo(‘template_directory’); ?>/flexslider.css” type=”text/css” media=”screen” /> <script src=”<?php echo get_bloginfo(‘template_directory’); … Read more

Last class on last headline?

$count = 1; is set in the while loop, so every time the loop runs it sets to 1 again. Place it before your loop and it will work. $count = 1; if (have_posts()) : while (have_posts()) : the_post(); Ow and the $count++ is outside the loop so it will only run after all the … Read more

How to execute a plugin on a single page only?

WordPress has a built-in function called wp_enqueue_script() which will allow a certain piece of JavaScript to be included in a page. If you’d just like to see that script on a particular page, you can conditionally call it from the theme file. For example: <?php if (is_page(‘home’)) { wp_register_script(‘custom_script’, get_template_directory_uri() . ‘/js/custom_script.js’); wp_enqueue_script(‘custom_script’); } ?> … Read more

Making that Admin Bar transparent or a blue color

There’s a good plugin to make the admin bar blue in both the admin and front-end: http://wordpress.org/extend/plugins/blue-admin-bar/ If those colors don’t suit, play around with the plugin to figure out how to do your own. The key thing to notice about the plugin version is that by using a hook to enqueue the stylesheets, it’s … Read more

Proper way to include stylesheet for panels

The best practice method of enqueueing admin stylesheets is to hook into your appearance page’s specific hook, using the admin_print_styles-{hook}, where {hook} = {admin_page}-{menu_slug}. I’ll assume: This is a Theme You are properly using an appearance page, via add_appearance_page() Your $menu_slug is wpse48416-settings The hook, then, is: admin_print_styles-appearance_page_wpse48416-settings: <?php function wpse48416_admin_style(){ wp_register_style( ‘wpse48416_admin_css’, get_template_directory_uri() . … Read more

How to know which order WordPress places CSS files?

1. Don’t edit your theme using the WordPress editor. This is a quick-and-dirty approach to development, but you can easily destroy your entire site by mistake with this tool. Instead, edit the files on your machine locally and then use FTP to upload the changed files to the server. 2. Moving the CSS will break … Read more

Search Bar in Thesis WordPress Site

The incorrect search is found under nav_container and is the second node div.search. Deleting the div with the search class ( div.search ) will remove that search bar and all the elements that came with it.