adding section
-
the number of panel sections is run via a filter;
overwrite it in functions.php of the child theme.example:
add_filter( 'twentyseventeen_front_page_sections', function() { return 6; } );
https://developer.www.ads-software.com/reference/functions/add_filter/
i dont find that code
` * @link https://developer.www.ads-software.com/themes/functionality/sidebars/#registering-a-sidebar
*/
function twentyseventeen_widgets_init() {
register_sidebar( array(
‘name’ => __( ‘Sidebar’, ‘twentyseventeen’ ),
‘id’ => ‘sidebar-1’,
‘description’ => __( ‘Add widgets here to appear in your sidebar.’, ‘twentyseventeen’ ),
‘before_widget’ => ‘<section id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</section>’,
‘before_title’ => ‘<h2 class=”widget-title”>’,
‘after_title’ => ‘</h2>’,
) );register_sidebar( array(
‘name’ => __( ‘Footer 1’, ‘twentyseventeen’ ),
‘id’ => ‘sidebar-2’,
‘description’ => __( ‘Add widgets here to appear in your footer.’, ‘twentyseventeen’ ),
‘before_widget’ => ‘<section id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</section>’,
‘before_title’ => ‘<h2 class=”widget-title”>’,
‘after_title’ => ‘</h2>’,
) );register_sidebar( array(
‘name’ => __( ‘Footer 2’, ‘twentyseventeen’ ),
‘id’ => ‘sidebar-3’,
‘description’ => __( ‘Add widgets here to appear in your footer.’, ‘twentyseventeen’ ),
‘before_widget’ => ‘<section id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</section>’,
‘before_title’ => ‘<h2 class=”widget-title”>’,
‘after_title’ => ‘</h2>’,
) );
}
add_action( ‘widgets_init’, ‘twentyseventeen_widgets_init’ );/**
* Replaces “[…]” (appended to automatically generated excerpts) with … and
* a ‘Continue reading’ link.
*
* @since Twenty Seventeen 1.0
*
* @return string ‘Continue reading’ link prepended with an ellipsis.
*/
function twentyseventeen_excerpt_more( $link ) {
if ( is_admin() ) {
return $link;
}$link = sprintf( ‘<p class=”link-more”>%2$s</p>’,
esc_url( get_permalink( get_the_ID() ) ),
/* translators: %s: Name of current post */
sprintf( __( ‘Continue reading<span class=”screen-reader-text”> “%s”</span>’, ‘twentyseventeen’ ), get_the_title( get_the_ID() ) )
);
return ‘ … ‘ . $link;
}
add_filter( ‘excerpt_more’, ‘twentyseventeen_excerpt_more’ );Don’t edit the theme’s functions.php file.
Create a Child Theme: https://codex.www.ads-software.com/Child_Themes
Then add it to your Child Theme functions.php file.i dont find that code
the suggested code is to be added into a functions.php of a child theme.
https://codex.www.ads-software.com/Child_Themes
https://codex.www.ads-software.com/Child_Themes#Using_functions.phpI added this filter to my child theme for Twenty Seventeen.
My home page now shows 6 slots for front page sections. However, when I go into my Theme Options, I only have the ability to set the pages for four of those six. How do I add pages for the fifth and sixth placeholders?
I have not installed any plugins on this site, and again, this is in my child theme.
https://drive.google.com/file/d/0B-VxMXYyIxJpMHd1TkZkaWI4Zjg/view?usp=sharing
I figured it out.
I had taken the filter from this link:
And just pasted it at the bottom of my functions.php file in my child theme. Instead, I needed to paste it before the ?>. I’m sure that’s basic .php coding, but I’m a designer, not a developer.
Hopefully that little tidbit helps someone else out along the way who might have the same problem.
- The topic ‘adding section’ is closed to new replies.