View All Posts in Category Externally (4 posts)

  1. acondiff
    Posted 6 years ago #

    I want to view all the posts in a category on an external page in the same domain. I figured it out but I get an error message on the page that is displaying the content. How do I get rid of this error message. I am not too familiar with php but I am trying. Here is the code at the beginning of my page:

    // Include WordPress
    define('WP_USE_THEMES', false);
    global $wp_query;
    array('cat' => 3),

    here is the code in the content box to display the content:

    <?php while (have_posts()): the_post(); ?>
    <h4><?php the_title(); ?></h4>
    <?php the_content(); ?>
    <?php endwhile; ?>

    here is the error message i get at the to of the page:

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /hermes/bosweb/web297/b2972/ipw.mcondiff/public_html/index.php on line 10

    Any help would be great!


  2. Mark / t31os

    Posted 6 years ago #

    Remove this part..

  3. acondiff
    Posted 6 years ago #

    i did and now i cant see my page at all and i get this error:

    Parse error: syntax error, unexpected ')' in /hermes/bosweb/web297/b2972/ipw.mcondiff/public_html/index.php on line 10

  4. Mark / t31os

    Posted 6 years ago #

    Yes sorry, and remove the comma just before that..

    array('cat' => 3),


    array('cat' => 3)

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.