I am customizing my WordPress site's theme and i need to use a different single.php file based on the condition.
Here is my user case, i need to design a competition page where i need to show entries submitted by the people.Entries can belong to various categories so it is not possible to trek them based on the categories.
I have created a tag (contest) and each entry belong to competition will be tagged with this tag, i can easily pick all entries based on this tag.
On the main navigation bar i have placed a link
"Contest" which will take user to the contest page, on this page i am showing all submitted entries with short description and link to go to story page.
This is how i am displaying data on custom competition page
$ppp = get_option('posts_per_page'); $args = array( "tag" => getContestPageData('tag_name'), 'posts_per_page' => 10, 'post_type' => 'post', 'orderby'=> 'date', 'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1) ); $posts=query_posts($args); foreach( $posts as $post ) : setup_postdata($post); ?> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"> <img src="<?php echo $random_image; ?>" alt="<?php the_title(); ?>" class="left"/> </a>
moment user click on the anchor link it redirect user to the
single.php page (if my understanding is correct)
I need Tweak main story page so as can design it with Competition theme in mind and i can do it with following option
- Put some conditional logic in
- For all user who click story link on my custom page, land them on some other page say
Is this possible? please link to me appropriate resource or examples