File: iinclude-page.php
Version: 0.4.7
Line: 132
Change:
if ($page = IIP::get_page($post_id, $type, $status)) {
to:
if ($post = IIP::get_page($post_id, $type, $status)) {
Line: 136
Change:
$title = $page->post_title;
to:
$title = $post->post_title;
Line: 145
Change:
$content = $page->post_content;
to:
//$content = $post->post_content; //this is redundant
Line: 146
Change:
$content = IIP::get_the_content($page,__($more),0,'',$displayStyle);
to:
$content = IIP::get_the_content($post,__($more),0,'',$displayStyle);
Thread Starter
mWoods
(@mwoods)
lancemonotone, thank you. I made all of these changes but it still won’t display a page in a post using this code: [include-page id=”562″]
I am having the same problem, I really liked this plugin and I hope they upgrade it to work with WordPress 3.0 soon!
I found out that the shortcode does work in WP 3.0 if you use the path instead of the page ID:
[include-page id=”/about/resume”]
At least it is working now for me and it didn’t before, and the only difference was that I had [include-page id=”12″].
I have a lot of plug ins so something may be conflicting with it, but at least I was able to get it to work with the path. Yay.
Thanks bdollproject! That fix worked for me, too. If I use the full path minus the domain, it works fine.
File: iinclude-page.php
Version: 0.4.7
Line: 189
Change from:
if( is_string($post_id) && function_exists(‘get_page_by_path’)) {
to:
else if( is_string($post_id) && function_exists(‘get_page_by_path’)) {
—-
When $post_id is numeric, variable $_page has been assigned page object at line 186.
But original code had overwritten $_page as invalid object at line 190.
‘1st If block’ at line 185-187 and ‘2nd If block’ at line 189-191 must be exclusive.
But ‘2nd If block’ lost ‘else’, those ‘If Block’s dose not become exclusive.
Thread Starter
mWoods
(@mwoods)
It looks like there is a bug in the latest version with some typecasting in the short-code handler. You should be able to fix it by replacing what is there in the plug-in (towards the end of the file) with this:
// Call IIP only with a valid ID
if (!empty($atts[‘id’]) && $post->ID != $atts[‘id’]) {
$page_id = $atts[‘id’];
if ( is_numeric( $atts[‘id’] ) )
$page_id = (int) $atts[‘id’];
$out = iinclude_page($page_id, implode(‘&’, $params), true);
} else {$out = ”;} // end if
If that doesn’t work, consider downgrading or contacting the plug-in developer. I will send this code to the developer for testing.