• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress a2z

WordPress a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Themes
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / twentyseventeen_front_page_section() – Display a front page section.

You appear to be a bot. Output may be restricted

Description

Display a front page section.

Usage

twentyseventeen_front_page_section( $partial, $id );

Parameters

$partial
( WP_Customize_Partial ) optional – Partial associated with a selective refresh request.
$id
( int ) optional – Front page section to display.

Returns

void

Source

File name: twentyseventeen/inc/template-tags.php
Lines:

1 to 30 of 30
function twentyseventeen_front_page_section( $partial = null, $id = 0 ) {
  if ( is_a( $partial, 'WP_Customize_Partial' ) ) {
    // Find out the ID and set it up during a selective refresh.
    global $twentyseventeencounter;

    $id = str_replace( 'panel_', '', $partial->id );

    $twentyseventeencounter = $id;
  }

  global $post; // Modify the global post object before setting up post data.
  if ( get_theme_mod( 'panel_' . $id ) ) {
    $post = get_post( get_theme_mod( 'panel_' . $id ) );
    setup_postdata( $post );
    set_query_var( 'panel', $id );

    get_template_part( 'template-parts/page/content', 'front-page-panels' );

    wp_reset_postdata();
  } elseif ( is_customize_preview() ) {
    // The output placeholder anchor.
    printf(
      '<article class="panel-placeholder panel twentyseventeen-panel twentyseventeen-panel%1$s" id="panel%1$s">' .
      '<span class="twentyseventeen-panel-title">%2$s</span></article>',
      $id,
      /* translators: %s: The section ID. */
      sprintf( __( 'Front Page Section %s Placeholder', 'twentyseventeen' ), $id )
    );
  }
}
 

 View on GitHub View on Trac

Published: 8th April 2020 | Last updated: 21st August 2020

Primary Sidebar

Information

Function name: twentyseventeen_front_page_section
Plugin ref: Twenty Seventeen
Version: 3.1
Sourcefile: inc/template-tags.php
File ref: inc/template-tags.php
Deprecated?: No
API Letters: F,P,S,T

Footer

WordPress a2z
WordPress a2z
WordPress Dynamic API Reference
WordPress 6.1.1. PHP: 8.0.28
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wp-a2z.org
© Copyright WordPress a2z 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites