0
出於某種原因,在Genisis框架,WordPress的下面的代碼不拉子頁面和它的特色照片兒童網頁和他們的特色照片父頁面不拉在WordPress
add_filter('body_class', 'add_body_class');
function add_body_class($classes) {
$classes[] = 'portfolio';
return $classes;
}
add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); // Force Full-Width Layout
remove_action('genesis_before_loop', 'genesis_do_breadcrumbs'); // Removes breadcrumbs
remove_action('genesis_post_title','genesis_do_post_title'); // Removes post title
remove_action('genesis_post_content', 'genesis_do_post_content'); // Removes content
add_action('genesis_post_content', 'child_do_content'); // Adds your custom page code/content
// Do Custom Content
function child_do_content() { ?>
<?php global $wpdb; ?>
<?php the_content(); ?>
<?php
$child_pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = ".$post->ID." AND post_type = 'page' ORDER BY menu_order", 'OBJECT'); ?>
<?php if ($child_pages) : foreach ($child_pages as $pageChild) : setup_postdata($pageChild); ?>
<?php echo get_the_post_thumbnail($pageChild->ID, 'thumbnail'); ?>
<a href="<?php echo get_permalink($pageChild->ID); ?>" title="<?php echo $pageChild->post_title; ?>"><?php echo $pageChild->post_title; ?></a>
<?php endforeach; endif; ?>
<?php }genesis();
謝謝。