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
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.
You should write in the template file in the index.php and this looks like a core file:
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