Please help! - wordpress dual content pulling conundrum

Discussion in 'Blogging' started by WillPooleDesigns, Jan 27, 2012.

  1. #1
    2.jpg


    I'm doing a personal web project called ZENADAY, it's a wordpress blog. I want to publish everyday (hence name).

    At position B I can add new pictures using the thumbnail box in the wordpress dashboard.

    My Conundrum is that I want to create a second content box at position A, to add new quotes each day.

    Is there a way of having two content boxes in the dashboard?, or splitting the content between two divs?

    I don't what the quote to be the TITLE of the post if it can be helped.

    Thank you in advance
     
    WillPooleDesigns, Jan 27, 2012 IP
  2. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #2
    Of course there is a way. It will probably involve some editing of the template. You either do it as just an HTML hack and you would have to place the content in manually when you want to change it, or you can edit using the loop and display post content by category or tags.
     
    hmansfield, Jan 27, 2012 IP
  3. WillPooleDesigns

    WillPooleDesigns Greenhorn

    Messages:
    21
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    13
    #3
    Ok, Thanks for the reply.

    For anyone else who has the same problem. The following method is the easiest method I found.

    It uses the wordpress 'read more' tag, usually used for splitting a long post up, so posts on a blog are quicker to scroll through.


    1. Create a functions.php(if you all ready haven't) in you theme folder and input following code -


    <?php

    // split content at the more tag and return an array
    function split_content() {
    global $more;
    $more = true;
    $content = preg_split('/<span id="more-\d+"><\/span>/i', get_the_content('more'));
    for($c = 0, $csize = count($content); $c < $csize; $c++) {
    $content[$c] = apply_filters('the_content', $content[$c]);
    }
    return $content;
    }

    ?>



    2. In you wordpress loop replace
    -

    <?php the_content(); ?>

    with


    <?php $content = split_content(); ?>


    3. Add these two lines after the code above in the two div's you want the text in your index.php,single.php etc... -

    First area code - <?php echo '<div id="column1">', array_shift($content), '</div>'; ?>

    Second area code -
    <h2><a href"<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>


    (Remember! these pieces of code need to be kept in the loop. Make sure the code below is before the code in step 3)

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

    <?php $content = split_content(); ?>



    See ya...
     
    WillPooleDesigns, Jan 28, 2012 IP