开发者

more flexible or advanced page creation in wordpress 3.2.1

I've been looking开发者_开发百科 into ways to make the wordpress page creation be a little more flexible.

I've gotten as far as defining my own template pages and using those to create the new pages, but I'd like to be able to have a way to input content for more than just the one post div.

When creating a page it is similar to creating a post - i.e you get to edit a title and a bit of content but that's it.

Does anyone know of a method or plugin that would allow editing the title and content of 2 divs on the same page during page creation?


I suggest you use Magic Fields. It basically allows you to add a lot of custom fields. It allows you to build advanced templates. Example of one I created recently:

<?php get_header();?> <div id="left_sidebar" class="grid_3">
    <ul class="post_menu sf-menu sf-vertical">
        <li class="active"><a href="<?php echo get_pagelink($post->ID); ?>"><?php echo $post->post_title; ?></a></li>

        <?php $currentPost = $post; ?>

        <!-- Start Loop -->
        <?php   $args=array(
                  'post_type' => "post",
                  'category__in' => get_page_cats($post->ID),
                  'showposts' => '5000',
                  'order_by' => 'date',
                  'order' => 'ASC');
        ?>
        <?php $menu_posts = array(); ?>

        <?php $the_query = new WP_Query( $args );?>
        <?php if ($the_query->have_posts()) : while ($the_query->have_posts()) : $the_query->the_post(); ?>

         <?php if($related_content = get('menu_parent_page')): ?>
            <?php $menu_posts[$related_content]['sub'][] = array('id' => $post->ID, 'title' => $post->post_title); ?>
         <?php else: ?>
            <?php $menu_posts[$post->ID]['parent'] = array('id' => $post->ID, 'title' => $post->post_title); ?>
         <?php endif; ?>

        <?php endwhile; else: ?>

        <?php endif; ?> 
        <?php wp_reset_query(); ?>


        <?php $postCount = 1; ?>
        <?php $totalPosts = sizeof($menu_posts); ?>

        <?php if($totalPosts > 0):?>    
        <?php foreach($menu_posts as $the_post): ?>
            <li <?php if($postCount == $totalPosts): ?> class="last<?php if($currentPost->ID == $the_post['parent']['id']): ?> active<?php endif; ?>"<?php elseif($currentPost->ID == $the_post['parent']['id']): ?> class="active"<?php endif; ?> ><a href="<?php echo get_pagelink($the_post['parent']['id']); ?>"><?php echo $the_post['parent']['title']; ?></a>

        <?php $totalSubPosts = sizeof($the_post['sub']); ?>
        <?php $subPostCount = 1; ?>

        <?php if($totalSubPosts > 0):?> 
        <ul>
            <?php foreach($the_post['sub'] as $sub_post): ?>
                    <li <?php if($subPostCount == $totalSubPosts): ?> class="last" <?php endif; ?>><a href="<?php echo get_pagelink($sub_post['id']); ?>"><?php echo $sub_post['title']; ?></a>
            <?php $subPostCount++; ?>
            <?php endforeach; ?>


        </ul>
        <?php endif; ?>
         </li>
        <?php $postCount++; ?>

        <?php endforeach; ?>
        <?php endif; ?>

    </ul>
</div>

<div id="page_content" class="grid_9">

    <!-- Start Loop -->
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
        <h1 class="page_header"><?php the_title(); ?></h1>
        <?php the_content(); ?>
                        <?php $logo_image = get_image('extra_logo_image', 1, 1, 0);  ?>
        <?php if($logo_image): ?>
        <img class="brand_logo_all" src="<?php echo $logo_image; ?>" alt="logo" />
        <?php endif; ?>
    <?php endwhile; else: ?>
        <p>An Error Occurred</p>
        <?php endif; ?> 
    <?php wp_reset_query(); ?>
    <!-- End Loop -->

    <?php $download_items = get_group('download'); ?>
    <?php if($download_items): foreach ($download_items as $item): ?>
    <div class="download">
        <a href="<?php echo $item['download_pdf'][1];?>">
            <div class="pdf">
                <table>
                    <tr>
                        <td><?php echo $item['download_description'][1];?></td>
                    </tr>
                </table>
            </div>
        </a>
    </div>
    <?php endforeach; endif;?>


    <?php $disable_call_to_action = get('extra_disable_call_to_action'); ?>
    <?php if(!$disable_call_to_action): ?>
    <?php include_once(TEMPLATEPATH . "/call_to_action.php"); ?>
    <?php endif; ?>

    </div><!-- #page_content -->



</div><!-- #container --><?php get_footer();?>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜