Forums

Can I make a post always stay at the top of the page? (11 posts)

  1. whatladiesthink2
    Member
    Posted 1 year ago #

    We have an intro paragraph on our main page that we'd like to ALWAYS stay at the top. All the other blog posts would need to go underneath of it.

    Is there a way to make this happen?

    Our site is at http://whatladiesthink.com/wordpress

    Thank you!

  2. epicalex
    Member
    Posted 1 year ago #

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

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

  3. pizdin_dim
    Member
    Posted 1 year ago #

    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".

  4. jonimueller
    Member
    Posted 1 year ago #

    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

  5. macbis
    Member
    Posted 1 year ago #

    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.

  6. whatladiesthink2
    Member
    Posted 1 year ago #

    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(); ?>

  7. macbis
    Member
    Posted 1 year ago #

    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.

  8. rudolf45
    Member
    Posted 1 year ago #

    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... :)

  9. jonimueller
    Member
    Posted 1 year ago #

    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

  10. jonimueller
    Member
    Posted 1 year ago #

    aack, it wasn't quite what I was after.. :-(

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

  11. macbis
    Member
    Posted 1 year ago #

    I find that it rarely is ;)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.