Put HTML tags into wordpress post title

May 25, 2010

You don’t want to go putting HTML tags directly into post titles. It might show up OK on your own site, but it can be problematic. For example, your titles through RSS will show the tags as next, not render them, here is almost-as-simple way to go about it. 1. Enter title without HTML 2. Create a custom field “HTML_title” for the title with HTML 3. Output custom field on pages you want the HTML For example, on the single.php page where you would have used <h1><php the_title(); ?></h1> Now... [Read the full story]

Redifine wordpress title tag with a custom field

February 1, 2009

Open your header.php file for edition. find the <title> tag, and replace it by the following code: <title> <?php if (is_home () ) { bloginfo('name'); } elseif ( is_category() ) { single_cat_title(); echo ' - ' ; bloginfo('name'); } elseif (is_single() ) { $customField = get_post_custom_values("title"); if (isset($customField[0])) { echo $customField[0]; } else { single_post_title(); } } elseif (is_page() ) { bloginfo('name'); echo ': '; single_post_title(); } else... [Read the full story]

Get wordpress parent page or post title

January 28, 2009

If you use pages and subpages or posts and parent posts on your WordPress blog, it should be a good idea to display parent page/post title while on a child page. Here’s a code to do that job easily. To achieve this recipe, simply edit your page.php file and paste the following code where you’d like your parent page title to be displayed: <?php $parent_title = get_the_title($post->post_parent); echo $parent_title; ?> That’s all. Also, this code should be some inspiration for creating breadcrumbs.  Read More →

Link to some external resource in wordpress post title

January 16, 2009

Sometimes, you may want to publish a post which only consist of an url pointing to some external resource. As there’s no built-in function to do that in wordpress, let’s create our own.   The first thing to do is to open your functions.php file and paste the following code:   function print_post_title() { global $post; $thePostID = $post->ID; $post_id = get_post($thePostID); $title = $post_id->post_title; $perm = get_permalink($post_id); $post_keys = array(); $post_val = array(); $post_keys... [Read the full story]

Make your wordpress title tag SEO friendly

December 29, 2008

SEO is a very important part of your wordpress blog. Because without a good SEO, you’re loosing lots of potential visitors. In this recipe, we will know how to optimise the title of your wordpress blog for a better SEO. Open your header.php file for edition. find the <title> tag, and replace it by the following code:   <title> <?php if (is_home () ) { bloginfo('name'); } elseif ( is_category() ) { single_cat_title(); echo ' - ' ; bloginfo('name'); } elseif (is_single() ) { single_post_title(); }... [Read the full story]