WordPress.org

Ready to get started?Download WordPress

Forums

Multiple Loops problem: make plugins parse their special tags (5 posts)

  1. Elan42.com
    Member
    Posted 4 years ago #

    Hi ...

    I'm currently doing well a multiple loop, but, I need a plugin (WordTube) to interpret the tags in a certain post.

    Infact I'm getting the "[wordtube vars]" string instead of some multimedia players that the plugin should output.

    That is the code:

    $the_query = new WP_Query($args);
    $articoli=$the_query->posts;
    $my_id = $articoli[0]->ID;
    $post_id_7 = get_post($my_id, ARRAY_A);
    $content = $post_id_7['post_content'];
    echo $content;
  2. esmi
    Forum Moderator
    Posted 4 years ago #

    You need to use the_content() - not ['post-content'] - if you want the text parsed and formatted.

  3. Elan42.com
    Member
    Posted 4 years ago #

    Ok, but how do I pass $post_id_7 to the_content() ?

  4. Elan42.com
    Member
    Posted 4 years ago #

    My problem is that using that functions (like the_content) I find post duplicates with my new query, because it's not the first but the second one.

    So I made a query to find only the right ID of the right post, and I hoped to take out it's content only.

    What can I do?

  5. esmi
    Forum Moderator
    Posted 4 years ago #

    <?php
    $articoli = get_posts(''p' => 10');
    foreach($articoli as $post) :
    	setup_postdata($post);
    	the_content();
    endforeach;
    wp_reset_query();
    ?>

    http://codex.wordpress.org/Function_Reference/get_posts

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.