CodeCanyon

Which method are you using for creating a custom homepage in WP?

531 posts
  • Bought between 10 and 49 items
  • Contributed a Blog Post
  • Elite Author
  • Exclusive Author
  • Germany
  • Has been a member for 3-4 years
  • Referred between 100 and 199 users
+1 more
radykal says

Hey guys,

which method are you using to create a custom homepage? So far I used the index.php with this filter hook:

function home_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'home_page_menu_args' );

But there are several other solutions, like home.php, front-page.php or a custom template. I would like to use a different method now, so users select the frontpage under Settings->Reading. When using this method, is it still possible to insert the code in the index.php? If not, how can the index.php be used, because I also create a template for my blog?

2478 posts Premium Scripts, Plugins and Themes
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 6-7 years
  • Interviewed on the Envato Notes blog
  • Microlancer Beta Tester
  • Referred between 200 and 499 users
+1 more
LucidStudios says

I think the only scenario to reserve the index.php for the blog page will be when you choose A static page for the “Front Page” option and don’t choose a page for the “Posts Page” option.

by
by
by
by
by