Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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