Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no onepage function #2

Closed
phn2211 opened this issue Nov 27, 2017 · 4 comments
Closed

no onepage function #2

phn2211 opened this issue Nov 27, 2017 · 4 comments

Comments

@phn2211
Copy link

phn2211 commented Nov 27, 2017

Why can I just set 4 additional pages in the costumizer?
I already edited the functions.php
$num_sections = apply_filters( 'twentyseventeen_front_page_sections', 8 ); without result.

Edit: I found this snippet in "inc/costumizer.php" I think I have to create this file in the child theme and add this code to it?

@strarsis
Copy link
Owner

strarsis commented Nov 28, 2017

@phn2211: Ah, this can be confusing. The line with $num_sections calls the filter to get the amount of pages that has been set currently (the 8 is just a fallback value in case nothing has been set yet).
That variable/line of code is used for something else in the theme, it isn't used for changing the amount but for finding it out.

For changing the amount of sections (pages), you can add this simple little code snippet to functions.php:

/*
 * A simple function to control the number of Twenty Seventeen Theme Front Page Sections
 * Source: wpcolt.com
 */
function twentyseventeen_custom_front_sections( $num_sections )	{
  return 7; // Change this number to change the number of the sections.
}
add_filter( 'twentyseventeen_front_page_sections', 'twentyseventeen_custom_front_sections' );

Edit: I added this as commented out example to functions.php so it is easy to enable if someone needs it: https://github.com/strarsis/twentyseventeen-onepage/blob/master/functions.php#L37

@phn2211
Copy link
Author

phn2211 commented Nov 28, 2017

Thanks strarsis, works great!
I have another question:

I would like to add the logo to the navbar and deactivate the header with sitetitle and sitedescription.
Therefore I edited the line in child header.php to
<?php /* get_template_part( 'template-parts/header/header', 'image' ); */?>

How do I set the logo to navigation? And how do I set post-picture instead of logo and title?

Thanks so much for your engagement!

@strarsis
Copy link
Owner

strarsis commented Jan 7, 2018

@phn2211: Sorry for the rather long delay. This child theme uses the twentyseventeen theme as parent, the logo markup is rendered here. For further modifying the theme, you have to create a new file in the child theme (in this case this single page theme you are already using) under the same relative path as the file of parent theme you want to modify.

So in this case this you would need to create a new file under the path 'components/header/site-branding.php' in the theme you are working on and copy + paste the complete contents of it over. Then you can start modifying it, e.g. moving <?php the_custom_logo(); ?> to a different place in the file – or removing it completely and adding it to another file (which you maybe also have to create and adjust as explained before).

@strarsis
Copy link
Owner

strarsis commented May 11, 2018

@phn2211: I assume your issue has been resolved and I closed it.
If you have still further questions, feel free to comment here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants