How to pull content from a WordPress Category/Archive page and set it up as the index of a subdomain?

I wanted to pull the contents (the whole page actually) of an archive/category page on WordPress to show in an address which is a subdomain.

Here’s what I want to see, the contents of this page: http://intorremolinos.co.uk/placecategory/accommodation/
Here’s the sample subdomain, where I want the previous to appear:catredi.intorremolinos.co.uk
Here’s the main domain:intorremolinos.co.uk

Read More

Right now, all that is showing is the exact same thing the homepage has.

I already have something though obviously it’s not working. Here’s the code I’m using, it’s on an index.php file on the subdomain folder.

<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/

/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define('WP_USE_THEMES', true);
$_GET['placecategory_id']=56;

/** Loads the WordPress Environment and Template */
require('../wp-blog-header.php');

I have very limited PHP knowledge as you can imagine, hope someone can help.

Related posts

Leave a Reply

1 comment

  1. You should write in the template file in the index.php and this looks like a core file:

    • Front to the WordPress application. This file doesn’t do anything, but loads
    • wp-blog-header.php which does and tells WordPress to load the theme.

    So go to your template and there are several ways of getting what you want. If you read the codex a bit, this code should go in the loop cause it is a query to a category

    Conditional statement with if your URL is like that then display the placecategory_id=56

    <?php
        $host = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
        if($host == 'intorremolinos.co.uk/placecategory/accommodation/') {
          query_posts("cat=56");
        }
    ?>