5 posts
  • Bought between 10 and 49 items
  • Has been a member for 2-3 years
UserFriendlyIT says

Hi All,

Working on our first WordPress theme to be converted from an existing, approved, single-page HTML template. Currently considering the best way to handle the structure of pages and how they will be included into the single page layout.

Here is what I’m currently considering: Each section in the one-page layout is a standard WordPress page using our theme’s ‘section’ template. At least one page must use the ‘Home’ template which is used to form the start of the page then loop through and pull in the rest of the sections. There will be a select/sort settings field in the options panel that will enable the user to add which sections they want included in the page and in what order . A toggle will allow switching between an automatically generated menu (based on selected page sections) and the WordPress menu function. Other necessary pages such as ‘blog’ are added to the end of the menu.

Shortcodes will be provided to give user access to the theme’s distinct features such as slide layouts, team, testimonials, columns and all the usual suspects. I understand that native WordPress facilities should be used wherever possible, so featured images etc. will be used where appropriate. It is also my understanding that content should always be portable in case the user changes themes. To support this, the shortcodes will be supplied in a plugin so the user can have access to their content after the change.

Does this sound like I am heading in the right direction? What is the generally accepted standard and best-practices approach to one-pagers? Can anyone offer suggestions?

Looking forward to a long and prosperous Themeforest journey!

Cheers, James

508 posts
  • Bought between 10 and 49 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Football Contest Participant/Runner-up
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says

I am just finishing a one page WP template and what I have done is:

- header and footer files are as normal - index.php pulls in every page via get_pages - loop through pages - shortcodes to add functions such as slider - menu is generated by the page order function, again using the get_pages function

1185 posts How's the surf doing?
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • United Kingdom
  • Referred between 200 and 499 users
  • Exclusive Author
  • Has been a member for 3-4 years
  • Envato Studio (Microlancer) Beta Tester
+1 more
tommusrhodus says

index.php pulls in every page via get_pages

I do the same but I do it with child pages so that the user can still create other pages.

Though I’m working on a one-pager at the moment that I’ve managed to get Aqua Page Builder to work for building the full page section by section, which is a little easier for the end user.

EDIT: Though index.php should always be reserved for the main blog loop, use a custom page instead for this or your theme will be rejected.

508 posts
  • Bought between 10 and 49 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Football Contest Participant/Runner-up
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says


index.php pulls in every page via get_pages

I do the same but I do it with child pages so that the user can still create other pages.

Though I’m working on a one-pager at the moment that I’ve managed to get Aqua Page Builder to work for building the full page section by section, which is a little easier for the end user.

EDIT: Though index.php should always be reserved for the main blog loop, use a custom page instead for this or your theme will be rejected.

Balls, I have the blog loop in another file (blog.php) but called from the index.php, basically I have to do a check and based on the check it shows the blog.php or another template for the one page system.

Going to have to rewrite this then?

1185 posts How's the surf doing?
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • United Kingdom
  • Referred between 200 and 499 users
  • Exclusive Author
  • Has been a member for 3-4 years
  • Envato Studio (Microlancer) Beta Tester
+1 more
tommusrhodus says

If you’re running specific checks against what’s being viewed then you may not have any issues with the review, but I can’t confirm that.

Personally I prefer to keep index.php as simple as possible and just run the blog loop only from it, tends to minimise conflicts with external plugins etc. as well.

508 posts
  • Bought between 10 and 49 items
  • Envato Studio (Microlancer) Beta Tester
  • Exclusive Author
  • Football Contest Participant/Runner-up
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • United Kingdom
Gareth_Gillman says

If you’re running specific checks against what’s being viewed then you may not have any issues with the review, but I can’t confirm that. Personally I prefer to keep index.php as simple as possible and just run the blog loop only from it, tends to minimise conflicts with external plugins etc. as well.

Yeah it’s just a quick if else of the front_page options in the settings > readings, and depending on the answer it either displays blog.php or another template (it’s a 2-in-1 template that the user can run as a multipage or single page).

186 posts
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 2-3 years
  • Sold between 1 and 100 dollars
  • United States
ThemeBuddies says

This is interesting. I tried using get_pages for a one page theme and I found that the function ignored page templates. All it would return was the page text. Did you get it to work?

917 posts
  • Author had a Free File of the Month
  • Beta Tester
  • Envato Studio (Microlancer) Beta Tester
  • Sold between 10 000 and 50 000 dollars
  • Bought between 50 and 99 items
  • Referred between 1 and 9 users
  • Football Contest Participant/Runner-up
  • Grew a moustache for the Envato Movember competition
  • Exclusive Author
+2 more
greenline says
Just curious: because Google included web site speed as part of their search ranking algorithm, do you guys use Google Page Speed to test your templates before going live? I mean this is required?
http://developers.google.com/speed/pagespeed/insights/
1579 posts Chris Robinson
  • United States
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Has been a member for 5-6 years
  • Author had a File in an Envato Bundle
  • Referred between 500 and 999 users
  • Author had a Free File of the Month
+5 more
contempoinc says

I use a “Home” custom post type, much better than using pages so they can still be used.

438 posts Don't be a HATER!
  • Exclusive Author
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Bought between 10 and 49 items
  • Referred between 10 and 49 users
  • Won a Competition
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Has been a member for 4-5 years
webinpixels says


If you’re running specific checks against what’s being viewed then you may not have any issues with the review, but I can’t confirm that. Personally I prefer to keep index.php as simple as possible and just run the blog loop only from it, tends to minimise conflicts with external plugins etc. as well.
Yeah it’s just a quick if else of the front_page options in the settings > readings, and depending on the answer it either displays blog.php or another template (it’s a 2-in-1 template that the user can run as a multipage or single page).

Me, using WordPress filter “template_include” for this. No “if else” etc. An option to activate/deactivate the one page on the theme option. When user activate the one page, WP will automatically read my “custom template” as index file. When it’s turned-off, it will using the settings in “Settings > Reading”.

by
by
by
by
by
by