• 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:

    <?php
    // Include WordPress
    define(‘WP_USE_THEMES’, false);
    require(‘./wordpress/wp-blog-header.php’);
    global $wp_query;
    query_posts(
    array_merge(
    array(‘cat’ => 3),
    $wp_query->query
    )
    );
    ?>

    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!

    Thanks!
    Austin

Viewing 3 replies - 1 through 3 (of 3 total)
  • Remove this part..

    $wp_query->query

    Thread Starter acondiff

    (@acondiff)

    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

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

    array('cat' => 3),
    $wp_query->query

    ..becomes..

    array('cat' => 3)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘View All Posts in Category Externally’ is closed to new replies.