Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Fixing WordPress
    In reply to: XML and WordPress
    Thread Starter derekelcreativecom

    (@derekelcreativecom)

    all right, i figured out a way to do this, though not necessarily the best way possible – so if anyone needs to know, give me a shout.

    Thread Starter derekelcreativecom

    (@derekelcreativecom)

    Hi. I appreciate the reply. I actually was already using the all in one plugin, but it didn’t allow me to have two different, arbitrary titles for each page. Before, i just pasted a simplified version of the code. I’m actually doing something similar to your code, using the category description as part of the category titles. And everything works except that i’m not able to pass two keyword phrases for each category, just the category description. If there’s any other thing i can set and use for each category, i’ll do it. Or, as a last resort, i guess i could use a long “if” statement in the header like:

    <? if (is_category('3')) { echo "Category 3"; ?>
    <? } elseif (is_category('5')) { echo "Category 5"; ?>
    <? } // and so on.... ?>

    That just seemed like a weird way to do it. And it just bugs me that i can’t get the variable thing to work.

    Here’s my full title code:

    <title>
    		<?php if(get_post_meta($post->ID, "page-keyword", true)) { ?>
            <?php echo get_post_meta($post->ID, "page-keyword", true); ?>
            <? } else { ?>
    
    				<? if(in_category('18') || in_category('3')) { // Stuff to do if this is a long-titled page ?>
    					<?php
                        $tit = the_title('','',FALSE);
                        echo substr($tit, 0, 45);
                        if (strlen($tit) > 45) echo "...";
                        ?>
    				<? } elseif (is_category()) { ?>
                    	<? //echo $pageKeyword ; ?>
                        <?php echo single_cat_title(); ?>
    
    				<? } else { wp_title(''); } ?>
    
        	<? } ?>
     | <?php bloginfo('name'); ?>
     <?php if(get_post_meta($post->ID, "general-keyword", true)) { ?>
     | <?php echo get_post_meta($post->ID, "general-keyword", true); ?>
     <? } elseif (is_category()) { ?>
     | <?php echo strip_tags(category_description()); } ?>
     </title>

Viewing 2 replies - 1 through 2 (of 2 total)