0
votes

I created my event pages with a different website. That website generated an html page for me(with Javascript, CSS hosted at their end) each time I created an event. I would like to embed the event pages into my website. In order to achieve, I tried to create a blank page template like below:

<?php
/**
* Template Name: Blank
*
*/

if (have_posts()) {
    while (have_posts()) { the_post();
        the_content();
    }
}
?>

Then pasted the content (including head and body) into WYSIWYG editor. However, WordPress pushes everything into body. How can I create a pure blank page template and have the ability to edit everything with WYSIWYG?

1

1 Answers

0
votes

Not quite sure if this is the best way to solve your problem. If I understand correctly you want to include events from website X in a page on website Y?

Assuming you set up events as a custom post type, you could use an 'event' RSS feed on website X: http://www.website-x/feed/?post_type=event

Then, on website Y reed the feed using:

$content  = file_get_contents('http://www.wesite-x/feed/?post_type=event');
$x        = new SimpleXmlElement($content);                   

foreach($x->channel->item as $entry) 
{
    $title      = $entry->title;
    //ETC...
}

It's not wysiwyg but it well get you all the content you need, and you can do whatever you want with it.

Hope this helps.