-1
我想用一個分頁到自定義後在自定義pages.I有在那裏我寫的代碼要在分頁自定義頁面添加到自定義後類型
<?php
function designs_theme_custom_post() {
register_post_type('logo-portflio',
array(
'description' => 'logo-portflio Post Type',
'show_ui' => true,
'menu_position' => 4,
'exclude_from_search' => true,
'labels' => array(
'name' => __('logo-portflio Items'),
'singular_name' => __('portflio Item'),
'add_new' => __('Add New logo portflio Item')
),
'public' => true,
'supports' => array('title', 'editor', 'custom-fields', 'excerpt', 'thumbnail'),
'has_archive' => true,
'rewrite' => array('slug' => 'logo-portflio'),
));
}
add_action('init', 'designs_theme_custom_post');
?>
和調用自定義posts.php頁後在徽標portfolio.php頁作爲
`<div class="portfolio">
<ul class="items col4 border">
<?php
global $post;
$args = array('posts_per_page' => 3, 'post_type'=> 'logo-portflio');
$myposts = get_posts($args);
foreach($myposts as $post) : setup_postdata($post); ?>
<?php
$portfolio_large = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'portfolio-large');
?>
<!-- /.filter -->
<li class="item thumb">
<figure class="icon-overlay icn-enlarge"><a href="<?php echo $portfolio_large[0]; ?>" class="fancybox-media" data-rel="portfolio"><?php the_post_thumbnail('portfolio-thumb'); ?> </a>
</figure>
<div class="bordered no-top-border">
<div class="info">
<h3 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<p><?php the_excerpt(); ?></p>
</div>
</div>
</li>
<!-- /.items -->
<?php endforeach; ?>
</ul>
</div>`
我現在做補充添加分頁自定義後類型定製page.plase幫我有人....