TerminalAddict
Active member
I'm attempting to create a single page application that gets some stuff from wordpress, and displays it in the page.
Reasons I'm using wordpress:
I need to keep a history of posts (basically that's the only reason)
While I'm typing this, I'm thinking of a more integrated way of doingthis
what I want is:
etc ...
can I replicate this using a phpCallback on a page?
perhaps some thing like
I'm about to give up on the wp integration as global constants, variables, and all sorts, start tripping over each other, this possible solution would give me a good result however.
presuamble once I've done this I could create a template, with a callback and use either xen:foreach (in the case of a list) or even xen:raw
any help very much appreciated.
Reasons I'm using wordpress:
I need to keep a history of posts (basically that's the only reason)
While I'm typing this, I'm thinking of a more integrated way of doingthis
what I want is:
- Some static content.
- Followed by some content that changes every month
- Followed by a list of previous things
- Intro bit
- this month's give away
- Previous give aways
PHP:
define('WP_USE_THEMES', false);
require_once('./wp/wp-blog-header.php');
// let's start by showing the "about" page
$args=array(
'post_type'=>'page',
'post__in' => array(27)
);
$my_query = new WP_Query($args);
while ($my_query->have_posts()): $my_query->the_post();
?>
<div class="sectionMain">
<div class="titleBar">
<h1><?php the_title(); ?></h1>
<p id="pageDescription-<?php echo $post->ID; ?>"> · What's all this FPS about then?</p>
</div>
<div class="pageNavLinkGroup"></div>
<div class="blog-entry" id="blog-<?php echo $post->ID; ?>">
<?php the_content(); ?>
</div>
</div>
<?php
endwhile;
?>
can I replicate this using a phpCallback on a page?
perhaps some thing like
PHP:
class FPS_HomePage_PageCallback_HomePage
{
public static function response(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract $response)
{
$fps_intro = getSinglePost('My intro post');
$fps_current_giveaway = getSinglePost('This Months Giveaway Post');
$fps_previous_giveaway = getListOfThreadFromCategory(CategoryNumber);
$response->params += array(
'FPS_intro' => $fps_intro,
'FPS_current_giveaway' => $fps_current_giveaway,
'FPS_previous_giveaway' => $fps_previous_giveaway
);
}
}
I'm about to give up on the wp integration as global constants, variables, and all sorts, start tripping over each other, this possible solution would give me a good result however.
presuamble once I've done this I could create a template, with a callback and use either xen:foreach (in the case of a list) or even xen:raw
any help very much appreciated.