Support » Fixing WordPress » Adding Custom fields & Taxonomy Category to Title Tag using All in One SEO Pack

  • Resolved maikunari

    (@maikunari)


    I am trying to create a custom title tag for a page that is using custom post types.

    What I’d like to have show in the title tag on the single page is:
    <title>Postname | Custom Field:manufacturer | Taxonomy Category Name | Sitename</title>

    I’m using the all in one seo plugin, I’m willing to change to a different plugin (platinum seo, yoast seo, etc) if this format can be created using them.

    Any help or suggestions would be greatly appreciated!

Viewing 1 replies (of 1 total)
  • Thread Starter maikunari

    (@maikunari)

    Here’s what I ended up doing:

    <title><?php
    
    if (is_page('inventory')) {
    wp_title( '' );
    
    // inventory page custom title tag
    //$title_tag = get_post_meta($post->ID, 'title', true);
    //	if ($title_tag) { echo $title_tag; }
    
    } 
    
    	global $page, $paged;
    
    if (!is_page('inventory')) {
    	wp_title( '' );
    }
    	// manufacturer custom field
    	$manufacturer = get_post_meta($post->ID, 'manufacturer', true);
    		if ($manufacturer) { echo ' ' . $manufacturer; }
    
    	// category
     	$categories= wp_get_object_terms($post->ID, 'division');
      	echo ' ' . $categories[0]->name;
    
    	// Add the blog name.
    	?> | <?php bloginfo( 'name' );
    
    	// Add the blog description for the home/front page.
    	$site_description = get_bloginfo( 'description', 'display' );
    	if ( $site_description && ( is_home() || is_front_page() ) )
    		echo " | $site_description";
    
    	// Add a page number if necessary:
    	if ( $paged >= 2 || $page >= 2 )
    		echo ' | ' . sprintf( __( 'Page %s', 'ms_base' ), max( $paged, $page ) );
    
    	?></title>
Viewing 1 replies (of 1 total)
  • The topic ‘Adding Custom fields & Taxonomy Category to Title Tag using All in One SEO Pack’ is closed to new replies.