I have a custom post type called "Static Content."

I would like to list those posts in the following secondary sidebar:

sidebar-secondary:

<div class="block-3 border-top">
    <?php
        // A second sidebar for widgets, just because.
        if ( is_active_sidebar( 'secondary-widget-area' ) ) : ?>

            <ul id="secondary-widget" class="xoxo">
                <?php dynamic_sidebar( 'secondary-widget-area' ); ?>
            </ul>

    <?php endif; ?>

</div><!-- #sidebar -->

Any suggestions?

link|improve this question

79% accept rate
feedback

1 Answer

you can use Query Posts plugin which creates a widget that you can place on that sidebar, and select what to display.

if you are looking to code your own the its a you are sure that you wont remove it from that side bar you can create a simple custom WP_query to selset your post type and list them. So you would need to change your code a bit like so:

<div class="block-3 border-top">
    <?php
        // A second sidebar for widgets, just because.
        if ( is_active_sidebar( 'secondary-widget-area' ) ) : ?>

            <ul id="secondary-widget" class="xoxo">
             <li><?php //your query and loop here ?> </li>

                <?php dynamic_sidebar( 'secondary-widget-area' ); ?>
            </ul>

    <?php endif; ?>

</div><!-- #sidebar -->

or you can just create your own widget and add it to the sidebar.

Hope this helps.

Ohad.

link|improve this answer
How do I create that own widget? – janoChen Feb 6 '11 at 18:44
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.