Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

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

Changing page content dynamically


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Aug 29, 2011, 04:47 AM
chrisrap
 
2 posts · Aug 2011
UK
Hi

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.
  #2  
Old Aug 29, 2011, 05:12 AM
chrisrap
 
2 posts · Aug 2011
UK
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);
    echo 
$content
Does that sound OK? Or have I made a terrible blunder that will cause problems later on?

Bookmarks

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 07:05 AM
[SOLVED] changing the content width mr55 Center area post/pages 5 Oct 1, 2010 05:50 AM
Chronological, full content list of posts on page other than the home page joshsweiss Center area post/pages 4 May 19, 2010 12:47 PM


All times are GMT -6. The time now is 04:13 PM.


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