• 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 ?’); ?>’

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter zirka

    (@zirka)

    <?php if(function_exists('iinclude_page')) iinclude_page(2, 'displayStyle=DT_TEASER_MORE&more=More information ?'); ?>

    Thread Starter zirka

    (@zirka)

    Actually I got the post to be displayed in my sidebar like so in sidebar.php:

    <?php
    $newpage = get_post_meta
    ($post->ID, 'newpage', true); ?>

    and then:

    <?php if(function_exists('iinclude_page')) iinclude_page(($newpage), 'displayStyle=DT_TEASER_MORE&more=More information ?'); ?>

    The value of the custom field would simply be any page number I want.

    Problem is, though, the page only displays in the sidebar when I am actually in the post that has my custom field. Is there a way for the new page to display on every page in the sidebar after I submit the custom field?

    Thread Starter zirka

    (@zirka)

    Did I post this problem in the wrong forum? If so, pls direct me to the right one.

    Thread Starter zirka

    (@zirka)

    Still having trouble getting custom fields to put my code into the sidebar on every single page and not just the post page that generated this custom field. Help?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Use Custom Fields to add new post/page to sidebar’ is closed to new replies.