Skip to main content
added 158 characters in body
Source Link
Axonn
  • 207
  • 1
  • 9

My archive.php starts like this:

        get_header(); ?>
        <?php if( have_posts() ): ?>
            <div id="container" class="portfolio-wrapper">
            <?php while( have_posts() ): the_post(); ?>

I'm curious... where is the actual WP Query made? For example when I press on a Category or on an Archive link, I get to this page, but where's the actual select done?

More specifically, I'm curious where the first query is created (in what file), since the above only uses a query which was already made somewhere.

I'm asking because I want to create a custom archive (using a shortcode with posts ids in it) and I want to seedecide what is the best approach to do that :).

My archive.php starts like this:

        get_header(); ?>
        <?php if( have_posts() ): ?>
            <div id="container" class="portfolio-wrapper">
            <?php while( have_posts() ): the_post(); ?>

I'm curious... where is the actual WP Query made? For example when I press on a Category or on an Archive link, I get to this page, but where's the actual select done?

I'm asking because I want to create a custom archive (using a shortcode with posts ids in it) and I want to see what is the best approach to do that :).

My archive.php starts like this:

        get_header(); ?>
        <?php if( have_posts() ): ?>
            <div id="container" class="portfolio-wrapper">
            <?php while( have_posts() ): the_post(); ?>

I'm curious... where is the actual WP Query made? For example when I press on a Category or on an Archive link, I get to this page, but where's the actual select done?

More specifically, I'm curious where the first query is created (in what file), since the above only uses a query which was already made somewhere.

I'm asking because I want to create a custom archive (using a shortcode with posts ids in it) and I want to decide what is the best approach to do that :).

Source Link
Axonn
  • 207
  • 1
  • 9

From where is archive.php getting its posts?

My archive.php starts like this:

        get_header(); ?>
        <?php if( have_posts() ): ?>
            <div id="container" class="portfolio-wrapper">
            <?php while( have_posts() ): the_post(); ?>

I'm curious... where is the actual WP Query made? For example when I press on a Category or on an Archive link, I get to this page, but where's the actual select done?

I'm asking because I want to create a custom archive (using a shortcode with posts ids in it) and I want to see what is the best approach to do that :).