Use Custom Fields to add new post/page to sidebar
-
Hello,
This is my objective: Whenever someone creates a new page or post I want it to be displayed in the sidebar, using custom fields makes it so that a page/post only appears in the sidebar when they want it to.
– I’m using the plugin ‘Improved Include Page’ to display the entire contents of a page in my sidebar. Right now I have to manually type in the page id I want to include in the sidebar within sidebar.php, but I’m hoping to eventually have it so that a normal user can just type in a custom field to get that to happen or for this whole process to just be automated.
– I’m also looking for a plugin that lets me use custom fields within pages, then maybe combine that with the ‘Improved include Page’ commands to get the pages to display within the sidebar.
– I guess I could also look into making a plugin that hooks into wordpress to autograb a new page id and auto-generate a new ‘Improved include page’ php command with said page id, inside sidebar.php.
– Here is example code in sidebar.php of how ‘Improved include page’ displays a page for me:‘<?php if(function_exists(‘iinclude_page’)) iinclude_page(2, ‘displayStyle=DT_TEASER_MORE&more=More information ?’); ?>’
- The topic ‘Use Custom Fields to add new post/page to sidebar’ is closed to new replies.