homepage as a menu
This commit is contained in:
parent
8c7448f358
commit
09eedb3850
@ -57,7 +57,7 @@ function register_ildi_menus() {
|
|||||||
register_nav_menus(array(
|
register_nav_menus(array(
|
||||||
'header-menu' => __('Header Menu', 'ildi'),
|
'header-menu' => __('Header Menu', 'ildi'),
|
||||||
'utility-menu' => __('Utility Links', 'ildi'),
|
'utility-menu' => __('Utility Links', 'ildi'),
|
||||||
// 'footer-menu' => __('Footer Menu', 'ildi')
|
'homepage-list' => __('HomePage List', 'ildi')
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,22 @@
|
|||||||
<div class="grid xs-col-100 sm-col-50 md-col-33 grid-gutter-lg">
|
<div class="grid xs-col-100 sm-col-50 md-col-33 grid-gutter-lg">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
$homeList = wp_get_nav_menu_items('homepage-list');
|
||||||
|
|
||||||
|
if($homeList){
|
||||||
|
foreach($homeList as $item){
|
||||||
|
$post = get_post($item->object_id);
|
||||||
|
|
||||||
|
?><section class="home-loop">
|
||||||
|
<a href="<?php echo get_page_link($post); ?>">
|
||||||
|
<h1><?php echo($post->post_title); ?></h1>
|
||||||
|
<?php echo(get_the_post_thumbnail($post)); ?>
|
||||||
|
</a>
|
||||||
|
</section><?php
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
$sticky = get_option( 'sticky_posts' );
|
$sticky = get_option( 'sticky_posts' );
|
||||||
$args = array(
|
$args = array(
|
||||||
'posts_per_page' => 12,
|
'posts_per_page' => 12,
|
||||||
@ -24,5 +40,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
wp_reset_postdata();
|
wp_reset_postdata();
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user