-
AuthorPosts
-
May 7, 2015 at 12:17 am #440698
Hello guys! I have just bought my 5th theme license! Thats how much I like your theme and appreciate your quick support. :)
I’m working on a 1 page site and some reasons hard to explain i need a product to be the homepage, but I don’t see such an option in the theme, any suggestions?
Thanks as always!
CheersMay 7, 2015 at 7:26 pm #441160Hi Gigi!
what do you mean you need a product to be the homepage? what exactly do you want to achieve? could you show us a screenshot/mockup to get a clear idea? A link to your website would help as well.
Cheers!
AndyMay 7, 2015 at 10:13 pm #441274Sorry I should have explained myself better, basically I have built this product page http://bit.ly/1DULcD0 and I need it to be the homepage because it’s the only way I can have the ecommerce functionality at the bottom (where user can choose size, upload file etc..)
Makes sense?
May 11, 2015 at 5:43 am #442206Hi!
It’s not possible to set a custom post type such as front page so you need to do a 301 redirect via .htaccess or add this code in the functions.php file:
add_action("pre_get_posts", "custom_front_page"); function custom_front_page($wp_query){ //Ensure this filter isn't applied to the admin area if(is_admin()) { return; } if($wp_query->get('page_id') == get_option('page_on_front')): $wp_query->set('post_type', 'product'); $wp_query->set('page_id', 241); //Set properties that describe the page to reflect that //we aren't really displaying a static page $wp_query->is_page = 0; $wp_query->is_singular = 1; $wp_query->is_post_type_archive = 0; $wp_query->is_archive = 0; endif; }Replace the page_id:
$wp_query->set('page_id', 241);Cheers!
IsmaelMay 11, 2015 at 9:19 pm #442698THIS WORKED GREAT!
Thank you o much!
-
AuthorPosts
- The topic ‘Make a product the Homepage’ is closed to new replies.
