Forum Replies Created

Viewing 15 replies - 16 through 30 (of 74 total)
  • Thread Starter mithrustt

    (@mithrustt)

    Yeah, I figured this out a few days ago and forgot to post back saying how.

    Basically, I took the single.php and put this code in:

    <?php
     if ( have_posts() ) { the_post(); rewind_posts(); }
     if ( in_category(25) || in_category (26) || in_category (27) || in_category (28) || in_category (29) || in_category (30) || in_category (31) || in_category (32) || in_category (33) || in_category (34) || in_category (35) || in_category (36) || in_category (38) ) {
     include(TEMPLATEPATH . '/singlereview.php');
     } else {
     include(TEMPLATEPATH . '/singlepost.php');
     }
     ?>

    Then I just created the two new templates and styled them the way I desired. Quite easy, actually, and once you get the basic code for one alternate template, it’s really easy to do it for more.

    I hope this helps anyone else looking for an answer to a similar question.

    Forum: Fixing WordPress
    In reply to: Author Links
    Thread Starter mithrustt

    (@mithrustt)

    Anyone have any ideas?

    Thread Starter mithrustt

    (@mithrustt)

    OK, I’ve switched that first bit of code with this, however, I still don’t know where I should be putting it, as everywhere I’ve tried messes stuff up.

    <?php
    $post = $wp_query->post;
    if ( in_category('25') ) {
       include(TEMPLATEPATH . '/singlereview.php');
    } else {
       include(TEMPLATEPATH . '/single.php');
    }
    ?>
    Thread Starter mithrustt

    (@mithrustt)

    I didn’t do anything. It’s just that the page has to be so short that no scrolling is necessary and it doesn’t reach the bottom of the screen.

    Thread Starter mithrustt

    (@mithrustt)

    Alright, so I tried to just edit my singlepost.php instead so that if it was a post in a certain category, it shows up as such, and if it was another category, it shows up a different way, and every other category shows up as such. But it doesn’t do what I have set up as a test.

    http://think-theory.com/test-review/

    Instead of showing the text ‘this is a test review’ or showing the addthis image and links beside that, it should say ‘This is some generic text to describe all other category pages, I could be left blank.’ This is the code I’ve used, which I got from the codex:

    <?php if (is_category('reviews')) { ?>
    <p>This is some generic text to describe all other category pages,
    I could be left blank</p>
    <?php } elseif (is_category('special reviews')) { ?>
    <p>This is the text to describe category B</p>
    <?php } else { ?>
    
    <div id="post">
    
                	<?php the_content('<p>Continue reading this post</p>'); ?>
    
    <div id="post_footer">
    	<div class="post_meta">
    						<!-- AddThis Button BEGIN -->
    <a href="http://www.addthis.com/bookmark.php" onclick="window.open('http://www.addthis.com/bookmark.php?wt=nw&pub=Saving Progress&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 'addthis', 'scrollbars=yes,menubar=no,width=620,height=520,resizable=yes,toolbar=no,location=no,status=no,screenX=200,screenY=100,left=200,top=100'); return false;" title="Bookmark and Share" target="_blank"><img src="http://s9.addthis.com/button1-addthis.gif" class='addthis' width="125" height="16" border="0" alt="Bookmark and Share" /></a>
    <!-- AddThis Button END --> <span class="dot">&sdot;</span> <?php if(function_exists('wp_email')) { ?> <?php email_link(); ?> <span class="dot">&sdot;</span> <?php } ?> <?php if(function_exists('wp_print')) { ?> <?php print_link(); ?><?php } ?>
    					</div>
    </div>
    </div>
    
    <?php } ?>

    Any ideas on what I’ve done wrong?

    Thread Starter mithrustt

    (@mithrustt)

    After reading those pages, it kind of seems (to me) that the category templates are more for archives, like, showing multiple posts of a certain category in a certain way. I just want to have an alternative to the single post template. If I were to make a new template, exactly the same as my single post template (for the sake of arguement) but just changed the background colour to a red and called the tempalte category-6.php, would it load for the single posts that are in that category or only for the archived posts in that category?

    I want to make it so this specific category uses the category-6.php for single posts, but not for the archives. Is this possible? As well, how do I find the category ID in WP 2.5? I have it so there are pretty permalinks, but I can’t seem to find where the cat ID is.

    mithrustt

    (@mithrustt)

    In your template that formats the page, you’ll have something like:

    <?php the_content('Read more'); ?>

    I had a similar situation where I didn’t want the ‘Read more’ to show up in the post, but in the footer of the post. So, I changed it to:

    <?php the_content(''); ?>

    And in my footer in my template page, I put this

    <div class="post_meta"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read more</a></div>

    This allows you to put the ‘Read more’ wherever you want since you can define the attributes of the class. This is just how I handled it, and there may be other/easier ways to do it, but it got the job done for me.

    Thread Starter mithrustt

    (@mithrustt)

    That was simple. And yeah, it didn’t affect anything else. Thanks a bunch!

    Thread Starter mithrustt

    (@mithrustt)

    Oh, I see. It’s the ‘!’ that was saying that if it is not home, show the second ad, otherwise, don’t show it.

    Thank you. All fixed now.

    Thread Starter mithrustt

    (@mithrustt)

    Unfourtunately, it didn’t change a thing.

    Thread Starter mithrustt

    (@mithrustt)

    Unfortunately it didn’t.

    Anyone else have any ideas?

    Thread Starter mithrustt

    (@mithrustt)

    http://www.think-theory.com

    Sorry, I always forget to include something, whether that’s a link to the site or the code I’m talking about. 😛

    Thread Starter mithrustt

    (@mithrustt)

    Well, I figured you meant to get the repeat and position in there and did that too. But, there’s still no background. Could it have something to do with where the <div class=’container’> is located in the header.php?

    Thread Starter mithrustt

    (@mithrustt)

    Do you mean move it in the CSS file or put the actual background image in the header.php?

    I copied that code you put and put it in my CSS as I didn’t have container class, but now I have no background image.

    Thread Starter mithrustt

    (@mithrustt)

    Ah, sorry. Never heard of the pastebin until now.

    http://wordpress.pastebin.ca/1020345

Viewing 15 replies - 16 through 30 (of 74 total)