Viewing 10 replies - 1 through 10 (of 10 total)
  • Alex Cragg

    (@epicalex)

    look into something called sticky posts, there are loads of plug-ins for it

    try here too http://codex.wordpress.org/Plugins/Posts_Miscellaneous
    😀

    Pizdin Dim

    (@pizdin_dim)

    If the text is going to be static, you could also just paste whatever text you want into your active theme’s index file, before “the loop”.

    jonimueller

    (@jonimueller)

    Yep, p_dim I think offers the better solution simply because I tried Owen Winkler’s sticky post plugin and I recall it hosed some other plugins so I had to disable it.

    If it’s a post that is actually a static part of your page, then embedding it in the index.php file is the best solution, IMHO.

    And you should put your static text (styled of course) right above this piece of code:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    We’ve done exactly that at our web design site with the “Welcome…” paragraph:

    http://www.pixelita.com/index.php

    macbis

    (@macbis)

    This is also the solution that I used (manually inserting text into the template). It works well with static content, as you’ve said, but wouldn’t work at all if you wanted your stickies to behave similar to forum software (ie. write a new post and have it stay and the top until removed/rotated).

    I was thinking about messing around with this concept using a ‘Sticky’ post category. The most recent post from that category would be displayed, followed by The Loop with that category (or at least that post– which would probably work better) excluded.

    Thread Starter whatladiesthink2

    (@whatladiesthink2)

    Here is my code from my main index template:
    I found the line I was supposed to put the text above, but when I pasted it in, I got nothing. I’m assuming I’m doing something wrong here, but not sure what. I’m sorry, I knew I shouldn’t have put those blonde streaks back in my hair last month. Thankfully it’s almost time to get a different color again. 🙂

    <?php get_header(); ?>

    <div id=”content”>

    <?php include(TEMPLATEPATH.”/l_sidebar.php”);?>

    <div id=”contentmiddle”>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <div class=”contentdate”>
    <h3><?php the_time(‘M’); ?></h3>
    <h4><?php the_time(‘j’); ?></h4>
    </div>

    <div class=”contenttitle”>
    <h1>” rel=”bookmark”><?php the_title(); ?></h1>
    <p><?php the_time(‘F j, Y’); ?> | <?php comments_popup_link(‘Leave a Comment’, ‘1 Comment’, ‘% Comments’); ?></p>
    </div>
    <?php the_content(__(‘Read more’));?>
    <!–
    <?php trackback_rdf(); ?>
    –>

    <?php endwhile; else: ?>

    <p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p><?php endif; ?>

    <h1>Comments</h1>
    <?php comments_template(); // Get wp-comments.php template ?>
    </div>

    <?php include(TEMPLATEPATH.”/r_sidebar.php”);?>

    </div>

    <!– The main column ends –>

    <?php get_footer(); ?>

    macbis

    (@macbis)

    It looks like you’ll want to insert your content above
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    and below

    <div id="contentmiddle">

    You’ll then need to replace to copy the post ‘stuff’ and replace the PHP with static values (or remove it completely). Like so:

    <div class="contentdate">
    <h3>Apr</h3>
    <h4>17</h4>
    </div>
    
    <div class="contenttitle">
    <h1>The Title</h1>
    April 17, 2007
    
    </div>
    This is the body of your post.
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    I’m not sure if that’ll work exactly, but it should get you close.

    rudolf45

    (@rudolf45)

    1. This “sticky” works: http://wordpress.org/extend/plugins/wp-sticky/
    2. You could edit the index.php file, too.
    3. You can include text from another file.
    4. You can use the get_a_post plugin, if you want the text to be editable from WP admin.

    Options… 🙂

    jonimueller

    (@jonimueller)

    Ah yes {{slaps forehead}}. I seem to recall a thread or article somewhere on this site about creating a way to pull in a post that was somehow marked first… I will try to find that. I think it will help you.

    Joni

    jonimueller

    (@jonimueller)

    aack, it wasn’t quite what I was after.. 🙁

    http://codex.wordpress.org/The_Loop_in_Action#Static_Front_Page

    macbis

    (@macbis)

    I find that it rarely is 😉

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Can I make a post always stay at the top of the page?’ is closed to new replies.