Forums

1 post 2 templates (4 posts)

  1. swarupredd
    Member
    Posted 8 months ago #

    Hi Every one!!

    I want to have 2 templates for a single post.On default page has to be loaded in one template but when i click a button (say download or Click here),post has to change to another template.Any idea of how to do.Can any one help me on this Please.

  2. Jeremy
    Member
    Posted 8 months ago #

    I am sure I fully understand what you're trying to do here.

    When the user clicks the button, should it lead him to a new specific page?

    If that's the case, you can have a different design for posts in different categories, by using Conditionnal tags, and using different classes depending on the category of the post.

    http://codex.wordpress.org/Conditional_Tags

  3. swarupredd
    Member
    Posted 8 months ago #

    Ya.Exact idea is when a user comes to any single post,One template has to display.Then when he Clicks the download button the same post will have to open in new template.I saw the link you have given..

    if ( is_single() ) {
    /* here what should be the code to put for me to get it that way*/
    }
    Don't mind if I'm asking the question a bit silly as I'm totally newbie to php..

  4. swarupredd
    Member
    Posted 8 months ago #

    i created a java script function like this..
    function displayActTemplate()
    {
    //alert("im called");
    <?php include (TEMPLATEPATH . '/single.php'); ?>
    }

    and when i click the button im calling this function..Will it work..

Reply

You must log in to post.

About this Topic