How to include this jQuery File in wordpress?

You should be using wp_register_script() and wp_enqueue_script(), so, for example: add_action( ‘wp_enquque_scripts’, ‘my_script_enqueue’ ); function my_script_enqueue() { wp_enqueue_script( ‘my-jquery’, ‘URL TO THE FILE’, array( ‘jquery’ ) ); } Also, as mentioned by Zack, you should be registering your jQuery as such, as wordpress does not use $ for jQuery by default. jQuery( document ).ready( function( … Read more

Using the_excerpt() on a page

While this was far from clear in the OP at first, I think this might be a good solution. Just make a shortcode to place the excerpt in the body. (This is a bad idea if you want this on every page. This is a good idea if you want it once in a while … Read more

Where is wp() function definition?

Just follow the code :). Before calling wp(), /wp-blog-header.php loads /wp-load.php (which assuming you have correctly installed WordPress) loads /wp-config.php. At the bottom of that file, it calls /wp-settings.php. This file loads a lot of other files, initialising the core parts of WordPress. Amongst them, is the wp-includes/functions.php file. It’s inside this file that wp() … Read more

Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view

Start by reading the notices–they tell you very explicitly what the problem is. Let’s start with the first one: Notice: Undefined index: _wr_event_speaker in /Users/my/htdocs/wr/wp-content/themes/wr/functions.php on line 246 First, this is just a “notice”. Meaning that no error has actually occurred. PHP is just telling you that something isn’t quite right, but that it skipped … Read more

Load Javascript from Plugin in One Page Only?

Drop this in your functions.php or a custom plugin. function wpse_57621_alo_tidy() { if ( $page_id = get_option( ‘alo_em_subsc_page’ ) ) { if ( ! is_page( $page_id ) ) remove_action( ‘wp_head’, ‘alo_em_ajax_js’ ); } } add_action( ‘wp’, ‘wpse_57621_alo_tidy’ ); It’s attached to the wp hook, which runs just after the request has been handled & queried. … Read more

Display WordPress Post Content in 3 Columns

Query the posts like you are known to it, but then get all posts and restructure them for the order you need it. Take care of setting up the global $post variable your own so that to ensure you template code still works. The array_chunk­Docs function normally comes in handy for column based output: $query … Read more

Adding Meta Tags to a Post using its Tags, Excerpt and content

I would keep out of your header.php & either add the following to your functions.php or wrap up as a plugin: add_action( ‘wp_head’, ‘wpse_71766_seo’ ); /** * Add meta description & keywords for single posts. */ function wpse_71766_seo() { if ( is_single() && $post_id = get_queried_object_id() ) { if ( ! $description = get_post_field( ‘post_excerpt’, … Read more