WordPress.org

Ready to get started?Download WordPress

Forums

Unique Requirement (6 posts)

  1. satyaki
    Member
    Posted 1 year ago #

    Hi Experts,

    I am new to WordPress and I have a problem which might be very basic!

    I wish to print the contents of the posts (say post ID 1,2,3 & 4) in a single post. How do I do that?

    Also the amount of the content that I need to print from posts (1,2,3 & 4) cannot be defined by number of characters. Can it be defined as up to the post dividing line? (or maybe I can put a code in HTML while writing the post and only up to that will be printed)

    Any ideas any one?
    Any plugin or programming concept?

  2. Andrew Bartel
    Member
    Posted 1 year ago #

    Sounds pretty simple for an experienced developer. Have you considered hiring someone?

  3. satyaki
    Member
    Posted 1 year ago #

    Hi Andrew,

    No. I haven't thought about hiring any one at this moment.

  4. satyaki
    Member
    Posted 1 year ago #

    Hi All,

    I was in fact thinking about for a long time and I guess this might just as well help me to solve my problem.

    Is there any shortcode by which I can show the excerpts of a post ID in another post?

    How is this possible?
    Also need to control the number of characters in the excerpt.

    Please help.

  5. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    You should be able to do this by using a custom query & Loop - suppressing the individual post titles by simply not outputting them in the Loop. You could use the <!--more--> tag in each post's content to mark the cutoff point for each post and then suppress the default "Read more" by using the_content('', false,'') instead of the_content().

    See:
    http://codex.wordpress.org/Function_Reference/query_posts
    http://codex.wordpress.org/Function_Reference/WP_Query
    http://codex.wordpress.org/The_Loop

  6. Funkywebsites
    Member
    Posted 1 year ago #

    <?
    ob_start();
    the_ID();
    $ID=ob_get_clean();
    $ID;
    #if ($ID==2 || $ID==3 || $ID==4 || $ID==5) {
    the_content()
    } else {
    echo "Show Nothing";
    }
    ?>

    hope this helps

    paste that into your theme page template :)

Topic Closed

This topic has been closed to new replies.

About this Topic