Viewing 5 replies - 1 through 5 (of 5 total)
  • That’s built-in to WordPress.

    If you hover your mouse over the icons about the post editor, you’ll see that one of those buttons inserts the “More” link.

    Thread Starter Cipta

    (@cipta)

    is not about “more” tag , Pls see this URL : https://www.hongkonglogue.com/guides/personal-information/ the content split into TWO COLUMNS. how to do that ?

    I wouldn’t call that “split content” so much as displaying posts in a columnar fashion — which is not hard to accomplish if you know what you’re doing in PHP.

    Your first step is to set up a two-column layout for the posts section on your blog using <div> tags and CSS. If you’re not knowledgable in this area, you’ll find numerous tutorials online. One good place is A List Apart. The Codex has a number of other resources:

    https://codex.www.ads-software.com/CSS

    Next (actually, finally) is the PHP handling the ‘split’ for your columns. A simple way to accomplish it is to insert a counter that ticks off every post, then tests for when it hits a certain number (and when it hits this, closes your first div column and opens the second).

    For an example we’ll assume you have 10 posts displayed and want 5 in each column. Initially we want to begin before The Loop your columns’ “holder” div along with the first column’s div:

    <div id="columns">

    <div id="column-left">
    <?php while(have_posts()) : the_post(); ?>

    Note the id’s here are examples. Use whatever you want; you can choose to use classes instead of unique id’s, as well.

    The code to count off posts is slipped in right after the start of The Loop:

    <?php while(have_posts()) : the_post(); ?>
    <?php $post_counter++; ?>

    Then we want to add the counter test and div insert after the counter but before any post content displays:

    <?php $post_counter++; if($post_counter == 6) : ?>
    </div>

    <div id="column-right">
    <?php endif; ?>

    Once The Loop ends you also need to close up your divs:

    <?php endwhile; ?>
    </div>

    </div>

    Now the example in full:

    <div id="columns">

    <div id="column-left">
    <?php while(have_posts()) : the_post(); ?>
    <?php $post_counter++; if($post_counter == 6) : ?>
    </div>

    <div id="column-right">
    <?php endif; ?>

    ~ Post content goes here ~

    <?php endwhile; ?>
    </div>

    </div>

    Thread Starter Cipta

    (@cipta)

    Thanks Kafkaesqui,

    i’m going to test your scripts. I will ask you again if found problem ??

    Warmest Regards

    sorry to digg old post

    well folling link will be usefull for slipt content as said above, where on the index page first post have the_content(with image and full post) and folling post have the _excerpt (wuth out image and short nip https://www.blazenewmedia.com/projects/durable

    Note :site is not belong to me

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to Split Content ?’ is closed to new replies.