Forums

post divider bars (11 posts)

  1. beachbum
    Member
    Posted 5 years ago #

    i am have a random divider bar for each post( http://islandcastaway.com/log/index.php ) but i would like it to show just between the days, not every post. my index.php is :

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

    <div class="post" id="post-<?php the_ID(); ?>">

    <?php the_date('','Captains Log Sea date ',''); ?> </h3><?php edit_post_link(__('Edit This')); ?>
    </div>
    <div class="storycontent">
    <?php the_content(__('(more...)')); ?>
    </div>
    <div class="feedback">
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    </div>
    </div>

    <img class="logo" src="<?php echo c2c_random_file('../clipart/bars/'); ?>" />

    <?php comments_template(); // Get wp-comments.php template ?>
    <?php endwhile; else: ?>

    <?php _e('Sorry, no posts matched your criteria.'); ?>

    <?php endif; ?>
    <?php posts_nav_link(' — ', __('« Previous Page'), __('Next Page »')); ?>
    <?php get_footer(); ?>

    how can i get this to just be once a day

    <img class="logo" src="<?php echo c2c_random_file('../clipart/bars/'); ?>" />

  2. beachbum
    Member
    Posted 5 years ago #

    ttt

  3. KatGirl
    Member
    Posted 5 years ago #

    Are the one line text in between those dividers your posts? or messages?

    I took a look but I couldn't work out where your "day" section stops and starts.

    Your font was extremely difficult to read.

  4. beachbum
    Member
    Posted 5 years ago #

    the dividers are the clipart bars in between each post(alot of 1 liners now, im testing sms messages). the day section starts "captains log log(date)"

    i only want the clip art divider bars once a day, not each post. im looking into the "<?php the_date" function to see how that is only called once.

    ps. this is from the wordpress classic theme

  5. beachbum
    Member
    Posted 5 years ago #

    heres the date function, im lost:
    function the_date($d='', $before='', $after='', $echo = true) {
    global $id, $post, $day, $previousday, $newday;
    $the_date = '';
    if ( $day != $previousday ) {
    $the_date .= $before;
    if ( $d=='' )
    $the_date .= mysql2date(get_settings('date_format'), $post->post_date);
    else
    $the_date .= mysql2date($d, $post->post_date);
    $the_date .= $after;
    $previousday = $day;
    }
    $the_date = apply_filters('the_date', $the_date, $d, $before, $after);
    if ( $echo )
    echo $the_date;
    else
    return $the_date;
    }

  6. beachbum
    Member
    Posted 5 years ago #

    need a php function to apply filters to show my code like "the_date" function.

  7. vkaryl
    Member
    Posted 5 years ago #

    Actually, if you're using the default setup (where the date only displays once per group of same-date posts) you could put the bars below the date, which might accomplish something similar to what you're looking for.

    Like this:

    <?php the_date('','<h3>','</h3>','<img src="link to image here" alt="" />'); ?>

    Note please that I haven't tried that code, but I *think* it should work.

    [Edit: no it does NOT work. Let me work on it some, 'kay?]

  8. beachbum
    Member
    Posted 5 years ago #

    1. putting it before the date would be better but messes up the top and bottom posts.

    2. i have a php echo inside my img cmd( <img class="logo" src="<?php echo c2c_random_file('../clipart/bars/'); ?>" />
    )

    3. im really looking for a day wrapper effect.

  9. beachbum
    Member
    Posted 5 years ago #

    need a php function to apply filters to show my code like "the_date" function.

  10. beachbum
    Member
    Posted 5 years ago #

    ttt
    i really really need a code like the_date to show a image only once per day,

  11. beachbum
    Member
    Posted 5 years ago #

    i cant believe that it is this hard to get a php function to show once per day.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.