Title: derekelcreativecom's Replies | WordPress.org

---

# derekelcreativecom

  [  ](https://wordpress.org/support/users/derekelcreativecom/)

 *   [Profile](https://wordpress.org/support/users/derekelcreativecom/)
 *   [Topics Started](https://wordpress.org/support/users/derekelcreativecom/topics/)
 *   [Replies Created](https://wordpress.org/support/users/derekelcreativecom/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/derekelcreativecom/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/derekelcreativecom/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/derekelcreativecom/engagements/)
 *   [Favorites](https://wordpress.org/support/users/derekelcreativecom/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [XML and WordPress](https://wordpress.org/support/topic/xml-and-wordpress/)
 *  Thread Starter [derekelcreativecom](https://wordpress.org/support/users/derekelcreativecom/)
 * (@derekelcreativecom)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/xml-and-wordpress/#post-1295304)
 * 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.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Pass Variables From Templates into Header](https://wordpress.org/support/topic/pass-variables-from-templates-into-header/)
 *  Thread Starter [derekelcreativecom](https://wordpress.org/support/users/derekelcreativecom/)
 * (@derekelcreativecom)
 * [16 years, 6 months ago](https://wordpress.org/support/topic/pass-variables-from-templates-into-header/#post-1260998)
 * 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)