Community Forums › Forums › Archived Forums › Design Tips and Tricks › Removing the Genesis post loop in the code in that file
Tagged: front page, front-page.php, no sidebar pro, welcome widget
- This topic has 5 replies, 2 voices, and was last updated 6 years, 6 months ago by Brad Dalton.
-
AuthorPosts
-
April 8, 2018 at 1:51 pm #218771timstodzMember
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 #218772Brad DaltonParticipantApril 8, 2018 at 2:37 pm #218773timstodzMemberHey 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', ) ) ) {
}
}
//* Run the Genesis function
genesis();April 8, 2018 at 2:39 pm #218774Brad DaltonParticipantReplace the entire file ( every character of code ) with the code in the Gist.
April 8, 2018 at 3:15 pm #218775timstodzMemberOh 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 #218787Brad DaltonParticipant -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.