• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Removing the Genesis post loop in the code in that file

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Removing the Genesis post loop in the code in that file

This topic is: not resolved

Tagged: front page, front-page.php, no sidebar pro, welcome widget

  • This topic has 5 replies, 2 voices, and was last updated 7 years, 1 month ago by Brad Dalton.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • April 8, 2018 at 1:51 pm #218771
    timstodz
    Member

    Hey,

    I'm creating a simple newsletter. I am using the no sidebar theme. I just want the homepage to be the newsletter signup. By default, the "home section" demands to display underneath.

    I emailed studiopress. They told me that...

    "The front-page.php file is for the home page template. You would have to remove the Genesis post loop in the code in that file to only have the widget content show."

    I see the front-page.php file in the editor, but I have no idea which line of code to remove. Can someone show me what to do? I know its a simple fix but I'm not a developer.

    http://bocadigest.com/
    April 8, 2018 at 2:24 pm #218772
    Brad Dalton
    Participant

    Something like this


    Tutorials for StudioPress Themes.

    April 8, 2018 at 2:37 pm #218773
    timstodz
    Member

    Hey Brad,

    Thanks man but honestly I have no clue what that means. So do I replace everything in the file with what you sent me? Or is what you send me what I need to remove?

    Here is the code for the file I'm supposed to edit. If you look at the http://www.bocadigest.com home page you'll see the home section underneath the fold that I need removed.

    <?php
    /**
    * This file adds the Front Page to the No Sidebar Pro Theme.
    *
    * @author StudioPress
    * @package No Sidebar
    * @subpackage Customizations
    */

    add_action( 'genesis_meta', 'ns_front_page_genesis_meta' );
    /**
    * Setup homepage posts grid.
    *
    */
    function ns_front_page_genesis_meta() {

    if ( 'posts' == get_option( 'show_on_front' ) ) {

    //* Remove breadcrumbs
    remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );

    //* Remove entry content elements
    remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
    remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
    remove_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12 );
    remove_action( 'genesis_entry_content', 'genesis_do_post_permalink', 14 );

    //* Remove the entry meta in the entry footer
    remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
    remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
    remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );

    //* Remove No Sidebar featured image
    remove_action( 'genesis_entry_header', 'ns_featured_image', 1 );

    //* Add post classes
    add_filter( 'post_class', 'ns_post_class' );

    //* Add first-page body class
    add_filter( 'body_class', 'ns_body_class' );

    //* Add featured image above the entry content
    add_action( 'genesis_entry_header', 'ns_front_featured_image', 4 );

    }

    }

    //* Enqueue full screen script
    add_action( 'wp_enqueue_scripts', 'ns_full_screen_script' );
    function ns_full_screen_script() {

    if ( is_active_sidebar( 'welcome-message' ) ) {

    wp_enqueue_script( 'ns-full-screen', get_stylesheet_directory_uri() . '/js/full-screen.js', array( 'jquery' ), '1.0.0' );

    }

    }

    //* Hook welcome message widget area after site header
    add_action( 'genesis_after_header', 'ns_welcome_message' );
    function ns_welcome_message() {

    if ( get_query_var( 'paged' ) >= 2 )
    return;

    echo '<div class="full-screen"><div class="widget-area">';

    echo '<h2 class="screen-reader-text">' . __( 'Welcome Content', 'no-sidebar' ) . '</h2>';

    genesis_widget_area( 'welcome-message', array(
    'before' => '<div class="welcome-message"><div class="wrap">',
    'after' => '</div></div>',
    ) );

    echo '</div></div>';

    }

    function ns_post_class( $classes ) {

    global $wp_query;

    $current_page = is_paged() ? get_query_var('paged') : 1;

    $post_counter = $wp_query->current_post;

    if ( 0 == $post_counter && 1 == $current_page ) {
    $classes[] = 'first-featured';
    }

    if ( ( $post_counter & 1 ) && 1 == $current_page ) {
    $classes[] = 'row';
    } elseif ( ( $post_counter % 2 == 0 ) && 1 !== $current_page ) {
    $classes[] = 'row';
    }

    if ( ( $wp_query->current_post + 1 ) == $wp_query->post_count ) {
    $classes[] = 'last';
    }

    return $classes;

    }

    function ns_body_class( $classes ) {

    $current_page = is_paged() ? get_query_var('paged') : 1;

    if ( 1 == $current_page ) {
    $classes[] = 'first-page';
    }

    $classes[] = 'front-page';

    return $classes;

    }

    function ns_front_featured_image() {

    if ( $image = genesis_get_image( array( 'format' => 'url', 'size' => 'ns-featured', ) ) ) {

    printf( '', $image );

    }

    }

    //* Run the Genesis function
    genesis();

    April 8, 2018 at 2:39 pm #218774
    Brad Dalton
    Participant

    Replace the entire file ( every character of code ) with the code in the Gist.


    Tutorials for StudioPress Themes.

    April 8, 2018 at 3:15 pm #218775
    timstodz
    Member

    Oh wow man... Thanks so much.

    One quick thing though? Before I just added that code you sent me, the entire background was white. Now, only the part behind the text of the signup form is white. Is there an easy fix to whiten out the entire back ground of the page?

    Thanks again for your help bud I hope I'm not bothering you.

    April 9, 2018 at 12:41 am #218787
    Brad Dalton
    Participant

    The entire page is white based on my testing of the code.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble