Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

Changing page content dynamically

Old Aug 29, 2011, 05:47 AM
2 posts · Aug 2011

I'm new to the forum so apologies if I'm posting in the wrong area or asking a silly question I have read quite a few forum posts but I can't find an answer to my current problem with Atahualpa 3.6.7 running on WordPress 3.2.1

I have created a custom template (page.php) by copying index.php (pretty standard stuff so far) and I have played around with the content. My problem is that I want to create the entire body content dynamically from a second database, resident on the same MySQL server. I have a block of PHP code that I am including but part of that content creates a WP short-code to position a gallery (tag-gallery) and of course, because this is just being output directly WP isn't processing the code in any way so the short-code just displays on the page.

So, I think I need to put the page content into a variable and then pass this to the WP the_content() function to be processed and output. Is this correct ... and how would I go about doing that within Atahualpa? I'm guessing that I can also rip out a lot of the index.php code in my new page.php because it doesn't have to worry about comments, archives and posts - it just has to display a header and the page content that I create from the other DB.

Anyway, sorry for a long first post - I hope someone can point me in the right direction

Thanks, Chris R.
Old Aug 29, 2011, 06:12 AM
2 posts · Aug 2011
Apologies for the false alarm ... I think I have found the answer by examining the the_content() function. Seems much easier than I thought it would be but I have copied out the code inside the_content() and just filled $content with my own content generated from the database:

PHP Code:
    $content $chriscontent;
$content apply_filters('the_content'$content);
$content str_replace(']]>'']]>'$content);
Does that sound OK? Or have I made a terrible blunder that will cause problems later on?


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I adjust a div height dynamically ? dinoc Center area post/pages 7 Dec 21, 2010 08:05 AM
[SOLVED] changing the content width mr55 Center area post/pages 5 Oct 1, 2010 06:50 AM
Chronological, full content list of posts on page other than the home page joshsweiss Center area post/pages 4 May 19, 2010 01:47 PM

All times are GMT -6. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.