garyb Posted March 15, 2021 Share Posted March 15, 2021 Hi, Would be most grateful if someone could give some advice. I have a html page which parses php. Within this page there is a small amount of CMS content which uses php and I'd also like to display some recent Wordpress blog content which also uses php. My issue is the blog content will display but the CMS content will not. Each will work on their own. Please excuse my ignorance here but what am I doing wrong? The code is this. <?php require('golf-blog/wp-blog-header.php');?> <?php $posts = get_posts('numberposts=4&order=DEC&orderby=post_date'); foreach ($posts as $post) : setup_postdata( $post ); ?> <h4><?php the_title(); ?> </h4> <?php the_excerpt(); ?> <?php endforeach; ?> <?php ob_start(); ?> {SCMS_CONTENT_2} <?php $pjSimpleCMS = 2; $pjHide = 1; include '/home/costa-blanca/public_html/cms/app/views/pjLayouts/pjActionLoad.php'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/312296-php-conflict/ Share on other sites More sharing options...
Strider64 Posted March 15, 2021 Share Posted March 15, 2021 You're not echoing out the content <h4><?php the_title(); ?> </h4> should be <h4><?php echo the_title(); ?> </h4> /* or this */ <h4><?= the_title() ?> </h4> Quote Link to comment https://forums.phpfreaks.com/topic/312296-php-conflict/#findComment-1585093 Share on other sites More sharing options...
maxxd Posted March 15, 2021 Share Posted March 15, 2021 It looks like you're mixing CMSs? WordPress by itself doesn't understand mustache notation, so {SCMS_CONTENT_2} means nothing to it unless you're using a theme or plugin that parses that code. 1 hour ago, Strider64 said: You're not echoing out the content the_title() will echo by default - you can turn echo off by passing false to the third parameter. Quote Link to comment https://forums.phpfreaks.com/topic/312296-php-conflict/#findComment-1585094 Share on other sites More sharing options...
garyb Posted March 15, 2021 Author Share Posted March 15, 2021 Thank you both for your prompt replies. Strider64 - I tried what you suggested and its still the same. maxxd - In terms of mixing CMS. I just pull some Wordpress content into an external html page. Wordpress exists on the site but it stands alone, I'm not using a Wordpress as CMS. The CMS is a simple script from a company called PHPjabbers. The {SCMS_CONTENT_2} is my CMS content and just brings a table to the page. So nothing I can do.....one or the other has to go? Quote Link to comment https://forums.phpfreaks.com/topic/312296-php-conflict/#findComment-1585095 Share on other sites More sharing options...
maxxd Posted March 15, 2021 Share Posted March 15, 2021 If you're pulling data from WordPress but not using it as the CMS (so basically, it's headless) then your page doesn't know what to do with the WordPress functions you're calling. That's what I mean by mixing CMSs, you're relying on the PHPjabbers stuff to handle the bracketed text replacement and WordPress to hand the_posts(), the_title(), the_excerpt(), etc. Pick one - make sure you include the proper WordPress handler code, or use WordPress and include the PHPjabber script in the WordPress template file and use it there. Quote Link to comment https://forums.phpfreaks.com/topic/312296-php-conflict/#findComment-1585124 Share on other sites More sharing options...
garyb Posted March 16, 2021 Author Share Posted March 16, 2021 maxxd, Thank you for taking the time to reply. I'm now using the Wordpress side in php and I'm loading the CMS with javascript. Small loss to seo but its a good compromise. Once again thank you.... Quote Link to comment https://forums.phpfreaks.com/topic/312296-php-conflict/#findComment-1585128 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.