Help me inserting the $posttag in a php include function!
-
i want that my blog does the following.
When the user is at
myblog.com/tag/coldplaydisplay the next article:
myblog.com/wp-content/themes/mytheme/articles/colplay.php at the top of the posts.now i have done this succesfully. i inserted this code in the archive.php
<?php echo ' '; if ( is_tag(coldplay) ) { ' » '; include(TEMPLATEPATH . '/articles/coldplay.php'); } echo ' '; ?>
but i want with the help of php, and $posttag save me some work since i have a lot of tags with lots of articles. (the article name is the same as the tag) but i dont know how to insert the tag in the “include” path.
can you help me? it′s the only thing that i need to run my theme smoothly. with what code should i replace the /articles/coldplay.php??
i was thinking in using
<?php echo ' '; if ( is_tag($posttag) ) { ' » '; include(TEMPLATEPATH . '/articles/$posttag.php'); } echo ' '; ?>
but it didn′t work. hope you can understand me. how can i get the tag name and assign it the value of $posttag?
thanks for your help!
- The topic ‘Help me inserting the $posttag in a php include function!’ is closed to new replies.