{"id":1209,"date":"2008-03-13T16:16:39","date_gmt":"2008-03-13T16:16:39","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/improved-include-page\/"},"modified":"2022-02-17T11:29:56","modified_gmt":"2022-02-17T11:29:56","slug":"improved-include-page","status":"closed","type":"plugin","link":"https:\/\/zh-sg.wordpress.org\/plugins\/improved-include-page\/","author":939922,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.2","stable_tag":"trunk","tested":"5.9.13","requires":"5.0","requires_php":"","requires_plugins":"","header_name":"Improved Include Page","header_author":"Marios Alexandrou","header_description":"","assets_banners_color":"709cd7","last_updated":"2022-02-17 11:29:56","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/infolific.com\/technology\/software-worth-using\/include-page-plugin-for-wordpress\/","header_plugin_uri":"http:\/\/infolific.com\/technology\/software-worth-using\/include-page-plugin-for-wordpress\/","header_author_uri":"http:\/\/infolific.com\/technology\/","rating":5,"author_block_rating":0,"active_installs":4000,"downloads":127404,"num_ratings":0,"support_threads":1,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"0.4.2":{"tag":"0.4.2","author":"vtardia","date":"2008-03-13 16:21:36"},"0.4.4":{"tag":"0.4.4","author":"vtardia","date":"2008-06-06 06:35:43"},"0.4.5":{"tag":"0.4.5","author":"vtardia","date":"2008-07-07 16:46:47"},"0.4.6":{"tag":"0.4.6","author":"vtardia","date":"2009-01-02 14:12:05"},"0.4.7":{"tag":"0.4.7","author":"vtardia","date":"2009-01-16 19:07:42"},"0.4.8":{"tag":"0.4.8","author":"vtardia","date":"2010-06-26 15:35:09"},"0.4.9":{"tag":"0.4.9","author":"vtardia","date":"2014-04-25 15:07:28"},"0.5.0":{"tag":"0.5.0","author":"vtardia","date":"2014-06-07 17:13:49"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"9"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":1352206,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":1352206,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500-rtl.png":{"filename":"banner-1544x500-rtl.png","revision":1352206,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":1352206,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250-rtl.png":{"filename":"banner-772x250-rtl.png","revision":1352206,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250},"banner-772x250.png":{"filename":"banner-772x250.png","revision":1352206,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.4.2","0.4.4","0.4.5","0.4.6","0.4.7","0.4.8","0.4.9","0.5.0"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[12491,36293,36294,36295,36296],"plugin_category":[],"plugin_contributors":[78248],"plugin_business_model":[],"class_list":["post-1209","plugin","type-plugin","status-closed","hentry","plugin_tags-include","plugin_tags-include-content","plugin_tags-include-html","plugin_tags-include-pages","plugin_tags-nested-content","plugin_contributors-marios-alexandrou","plugin_committers-marios-alexandrou"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/improved-include-page_709cd7.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Improved Include Page (IIP) uses the WordPress Shortcode API to include the content of any page inside any other page or post.<\/p>\n\n<h4>Using a shortcode in a post\/page:<\/h4>\n\n<p>[include-page id=\"123\"] OR [include-page id=\"\/about\/resume\"]<\/p>\n\n<h4>Using PHP in a template<\/h4>\n\n\n\n<p>For more details and examples, see the Installation tab.<\/p>\n\n<p>Improved Include Page is an enhanced version of the original Include Page developed by Brent Loertscher.<\/p>\n\n<h4>Key Features<\/h4>\n\n<ul>\n<li>Page title can be displayed with optional HTML code<\/li>\n<li>Content can be displayed with different styles (full, teaser, custom 'more' link)<\/li>\n<li>WordPress filters are applied to both the content and the title<\/li>\n<li>Supports the WordPress Shortcode API<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Download Improved Include Page<\/li>\n<li>Extract the zipped archive<\/li>\n<li>Upload the file 'iinclude_page.php' to the 'wp-content\/plugins' directory of your WordPress installation<\/li>\n<li>Activate the plugin from your WordPress admin 'Plugins' page.<\/li>\n<li>Include pages in your templates using 'iinclude_page' function or in your pages\/posts using the shortcode syntax.<\/li>\n<\/ol>\n\n<h4>How To Use<\/h4>\n\n<p>Once installed, the plugin adds the function 'iinclude_page':<\/p>\n\n<p>void <strong>iinclude_page<\/strong>(int post_id [,string params, boolean return = false])<\/p>\n\n<p>The function takes three parameters:\n1. the id of the page to include ('post_id')\n2. an optional string ('params') which contains the display options\n3. an optional boolean ('return') tells whether to return the content or display it on screen.<\/p>\n\n<h4>Example 1: using Shortcode API in posts or pages<\/h4>\n\n<p>You can include a page's content in a page\/post using the syntax:<\/p>\n\n<pre><code>[include-page id=\"123\"]\n<\/code><\/pre>\n\n<p>or<\/p>\n\n<pre><code>[include-page id=\"3\" displayTitle=\"true\" displayStyle=\"DT_TEASER_MORE\" titleBefore=\"&lt;h3&gt;\" titleAfter=\"&lt;\/h3&gt;\"  more=\"continue&amp;raquo;\"]\n<\/code><\/pre>\n\n<h4>Example 2: basic usage in templates<\/h4>\n\n<p>If you wish to include the content of page number '4' insert the following code into your template file (e.g. sidebar.php):<\/p>\n\n<pre><code>&lt;?php iinclude_page(4); ?&gt;\n<\/code><\/pre>\n\n<p>or<\/p>\n\n<pre><code>&lt;?php echo iinclude_page(4, null, true); ?&gt;\n<\/code><\/pre>\n\n<p>In order to avoid PHP errors if the plugin is disabled, you should use the function with the following syntax:<\/p>\n\n<pre><code> &lt;?php if( function_exists( 'iinclude_page' ) ) iinclude_page( 4 ); ?&gt;\n<\/code><\/pre>\n\n<h4>Example 3: using optional parameters in templates<\/h4>\n\n<p>You can also display the page title using the following code:<\/p>\n\n<pre><code>&lt;?php iinclude_page( 4, 'displayTitle=true&amp;titleBefore=&lt;h2 class=\"sidebar-header\"&gt;' ); ?&gt;\n<\/code><\/pre>\n\n<h4>Parameters<\/h4>\n\n<p>The current version supports the following parameters:<\/p>\n\n<dl>\n<dt>displayTitle (<em>boolean<\/em>)<\/dt>\n<dd>toggle title display<\/dd>\n\n<dt>titleBefore\/titleAfter (<em>string<\/em>)<\/dt>\n\n<dd>string to display before and after the title<\/dd>\n\n<dt>displayStyle (<em>integer constant<\/em>)<\/dt>\n<dd>one of the following:\n<ul>\n<li>`DT_TEASER_MORE` - Teaser with 'more&amp;' link (default)<\/li>\n<li>`DT_TEASER_ONLY` -Teaser only, without 'more' link<\/li>\n<li>`DT_FULL_CONTENT` - Full content including teaser<\/li>\n<li>`DT_FULL_CONTENT_NOTEASER` - Full content without teaser<\/li>\n<\/ul>\n<\/dd>\n\n<dt>more (string)<\/dt>\n<dd>text to display for the 'more' link<\/dd>\n<\/dl>\n\n<!--section=faq-->\n<dl>\n<dt id='can%20i%20include%20pages%20using%20custom%20fields%3F'><h3>Can I include pages using custom fields?<\/h3><\/dt>\n<dd><p>Yes, but there's an extra bit of code you need. To include a page, you now need to use this syntax:<\/p>\n\n<p>echo do_shortcode( get_post_meta( get_the_id(), 'custom_field_key', true ) );<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.2<\/h4>\n\n<ul>\n<li>Correct a warning issue by PHP related to a switch statement.<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Modified how password protected posts are handled. Thanks to piwel for the code.<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Confirming plugin works with WP 4.4 using both shortcode and template code.<\/li>\n<li>Bumping WordPress requirement to 4.0.<\/li>\n<li>Updates to description, documentation and tags.<\/li>\n<li>PHP code formatting tweaks.<\/li>\n<li>Support and development transferred from Vito Tardia to Marios Alexandrou.<\/li>\n<\/ul>\n\n<h4>0.5.0<\/h4>\n\n<ul>\n<li>Added the '#more-' in the \"read more\" link href, to avoid going to the top of the post when clicking (by Matthieu Sarter),<\/li>\n<li>Added support for the WordPress '' tag, so that the more link text can be defined at the post level (it can still be overriden at the 'iinclude_page()\/[include]' level) (by Matthieu Sarter).<\/li>\n<\/ul>\n\n<h4>0.4.9<\/h4>\n\n<ul>\n<li>Fixed static method definitions<\/li>\n<li>Fixed: returns false if a page is not found, without triggering a notice<\/li>\n<\/ul>\n\n<h4>0.4.8<\/h4>\n\n<ul>\n<li>Fixed bug which broke the ID style inclusion on WP 3.0 (thanks to Mike Woods, Brad Lauster and wptk)<\/li>\n<li><p>Fixed a bug on the 'more' link which caused too many slashes when using images as 'more tags' (thanks to Nikhil Dabas)<\/p>\n\n<p>Note: if you use HTML code in the 'more' link use single quotes for the 'more' parameter, like this:<\/p>\n\n<p>'[include-page id=\"mypage\" more='']'<\/p>\n\n<p>or you will have a PHP Warning<\/p><\/li>\n<li><p>Fixed a bug in the displayTitle attribute: using \"false\" you will get a real boolean false and title is hidden<\/p><\/li>\n<li><p>Added a new WP action 'include-page' to use inside your PHP code<\/p>\n\n<p>''<\/p><\/li>\n<li><p>Edited class attribute for the 'more' link. Now it is 'more-link' and 'iip-more-link'<\/p><\/li>\n<\/ul>\n\n<h4>0.4.7<\/h4>\n\n<ul>\n<li>On WP 2.5 or greater allows custom inclusion by post type and status using parameters 'allowType' and 'allowStatus'.<\/li>\n<li>Bug fix: in shortcode fixed a bug that could crash PHP when including recursive page\/posts<\/li>\n<\/ul>\n\n<h4>0.4.6<\/h4>\n\n<ul>\n<li>Bug fixed: since this version you can include only static pages with status of 'published'.<\/li>\n<\/ul>\n\n<h4>0.4.5<\/h4>\n\n<ul>\n<li>Page ID can be a valid page path (WP 2.1 or higher required) with contribution by Guy Leech.<\/li>\n<\/ul>\n\n<p>= 0.4.4\n* Added parameter $return (default = false) to iinclude_page() function\n* Added support for WP 2.5.x shortcode API<\/p>\n\n<h4>0.4.3<\/h4>\n\n<ul>\n<li>The code of this version it's been cleaned and optimized using WordPress API.<\/li>\n<\/ul>\n\n<h4>0.4.2<\/h4>\n\n<ul>\n<li>This version fixes a bug that triggers an error when used with some content filter: the '$page' global variable is backed up and then restored before returning.<\/li>\n<\/ul>\n\n<h4>0.4.1<\/h4>\n\n<ul>\n<li>This version contains a bug fix by <a href=\"http:\/\/www.funroe.net\/\">Jesse Plank<\/a>: resolves a compatibility problem with the plugin <a href=\"http:\/\/blog.firetree.net\/2005\/07\/18\/eventcalendar-30\/\">EventCalendar<\/a>.<\/li>\n<\/ul>","raw_excerpt":"Improved Include Page plugin allows you to include the content of a page in a template file or a post\/page (via a shortcode) with several options.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/zh-sg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/1209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zh-sg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/zh-sg.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/zh-sg.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=1209"}],"author":[{"embeddable":true,"href":"https:\/\/zh-sg.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/marios-alexandrou"}],"wp:attachment":[{"href":"https:\/\/zh-sg.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=1209"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/zh-sg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=1209"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/zh-sg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=1209"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/zh-sg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=1209"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/zh-sg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=1209"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/zh-sg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=1209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}