Articles of customization

Custom post type and body_class: Remove “blog” class

I am using body_class(); to style different sections of a wordpress site by their body class. Page styles descend from .page-template, blog styles descend from .single-post and/or .blog etc. I have created a custom post type “Products” for the products section of the site and want to style this section specifically using it’s body class, […]

Dynamically add / duplicate custom meta in custom post types

I am using Custom post types in one of my themes I have one custom post type called “accommodation” with meta boxes to add details such as type of rooms (single, twin, double…); each room has a price according to different season (high season, low season, peak season – each could be ). However the […]

Preventing Search Engines Indexing Pages 2, 3 and More?

Do you know how to prevent indexing of pages past the home page in WP? I mean I don’t want mysite.com/page/2, mysite.com/page/3 to be indexed. This is because I use home.php for my theme, so that page/2, page/3 are all the same. Please give me a hint or a code snippet please, I don’t want […]

How do I implement a .diff changeset from core.trac.wordpress.org locally?

I have a local copy of the latest version of wordpress that I set up using svn co http://core.svn.wordpress.org/trunk/ There is a diff that I want to pull into my local fileset: http://core.trac.wordpress.org/attachment/ticket/19371/19371.diff Is this something that I can do with subversion? What commands do I need to use?

Creating Search Engine Friendly URL's with Word Press

I own a website barrelandblade.com which was developed by a non SEO enlightened developer. I recently had the FV All in One SEO Pack installed as my site does not show up in the search engines at all. I understand my URLs should be representative of my page content but do not know how to […]

How to insert content from another Custom Post type into Post?

Say I have a custom post type called “Performers”. This gets populated with different bands/performers. These posts have a featured image as well as custom fields (mp3 file, facebook link, myspace link, etc). I have another custom post type called “Events”. When I create a new Event post, I would like the option to have […]

WordPress as thesaurus/dictionnary: what approach?

I’m willing to develop a thesaurus/dictionary for the Berber language. A website that allows comunity members to add new words/synonyms/antonyms.. How to relate words (posts) to each other? by using tags? but with this approach, it’s hard to keep organization when posts names/slugs are modified; then tags should be updated too.. consider the word “big” […]

simple expandable vertical menu, java script problem

I am trying to create a simple expandable menu in wordpress. Bellow you can see the javascript I am using (copy and mix from internet). <script type=”text/javascript”> $(document).ready(function($) { $(‘#access li’).has(‘ul’).addClass(‘has_submenu’); $(‘#access ul li.has_submenu a’).click(function() { $(“#access ul ul”).toggleClass(“showHide”); }); }); </script> The first part is ok, script adds has_submenu class to my menu. Second […]

Delete Post Link to delete post, its meta and attachments

I used // Delete Post Link function wp_delete_post_link($link = ‘Delete This’, $before = ”, $after = ”, $title=”Move this item to the Trash”, $cssClass=””) { global $post; if ( $post->post_type == ‘page’ ) { if ( !current_user_can( ‘edit_page’ ) ) return; } else { if ( !current_user_can( ‘edit_post’ ) ) return; } $delLink = wp_nonce_url( […]

How to link external JavaScript files?

I am working on a custom WordPress theme. I have everything working perfectly so far except for one thing: the external JavaScript files will not work. I followed the exact advice from the links here and here, but it still does not work. I have searched the codex, checked source code, used firebug. I have […]