WordPress.org

Forums

Twenty Thirteen
How to remove main menu and widget area from home page? (15 posts)

  1. Specules
    Member
    Posted 1 year ago #

    Hello,

    I'd like to have a home page that looks like an ordinary website.
    I would like to leave header and a blog name name as it is but I don't want menu and widget side appear on that page. They should be on the remaining parts of my blog though.

    Is there any simple way to do so without creating child templates etc?

    I know a "template" option when creating a new page unfortunately does not exist in Twenty Thirteen Theme.

  2. Josiah
    Member
    Posted 1 year ago #

    I wouldn't recommend doing that without a child theme because you would need to go into the index or home php file and edit those areas... as soon as you update, it will all go away.

  3. Specules
    Member
    Posted 1 year ago #

    Hi there,

    Ok than. Do you know any decent tutorial on how to properly use and create child themes?

  4. Josiah
    Member
    Posted 1 year ago #

    http://codex.wordpress.org/Child_Themes

    About as good as it gets.

  5. Josiah
    Member
    Posted 1 year ago #

    Hi again. I was just checking on you to see how the child theme quest was going.

  6. Specules
    Member
    Posted 1 year ago #

    Hello :) Thank you!

    I'm getting there. I managed to create child theme and now am trying to populate it with the elements I want to have there.

  7. Specules
    Member
    Posted 1 year ago #

    Rrrright....

    I have activated the child theme and made the changes so it looks like the "original". That was easy ;)

    However what I need to do to remove the menu and widget area? Please help.

  8. Josiah
    Member
    Posted 1 year ago #

    for the home page, create an index.php or home.php (whichever it is in 2013, I forget) file inside and then I would have the navigation menu hidden and the widgets hidden. Sorry, that's not very clear, but that's essentially what you are going for. If you edit the style.css, then it will make that happen universally and that's not what we want to do.

  9. Specules
    Member
    Posted 1 year ago #

    That would be index.php
    I've put it in the child theme catalog /wp-content/themes/twentythirteen-child

    the code for index.php is:

    <?php
    /**
     * The main template file.
     *
     * This is the most generic template file in a WordPress theme and one of the
     * two required files for a theme (the other being style.css).
     * It is used to display a page when nothing more specific matches a query.
     * For example, it puts together the home page when no home.php file exists.
     *
     * Learn more: http://codex.wordpress.org/Template_Hierarchy
     *
     * @package WordPress
     * @subpackage Twenty_Thirteen
     * @since Twenty Thirteen 1.0
     */
    
    get_header(); ?>
    
    	<div id="primary" class="content-area">
    		<div id="content" class="site-content" role="main">
    		<?php if ( have_posts() ) : ?>
    
    			<?php /* The loop */ ?>
    			<?php while ( have_posts() ) : the_post(); ?>
    				<?php get_template_part( 'content', get_post_format() ); ?>
    			<?php endwhile; ?>
    
    			<?php twentythirteen_paging_nav(); ?>
    
    		<?php else : ?>
    			<?php get_template_part( 'content', 'none' ); ?>
    		<?php endif; ?>
    
    		</div><!-- #content -->
    	</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
  10. Specules
    Member
    Posted 1 year ago #

    Hi Josiah,

    Could you please tell me how to have the navigation menu hidden and the widgets hidden?

    I have no idea what to do. I have tried different codes I have found in different forums but nothing works.

  11. Josiah
    Member
    Posted 1 year ago #

    Ok. Sorry, I have been out of town at conferences and could not get back to you sooner. Let's start with nav and try eliminating:

    <?php twentythirteen_paging_nav(); ?>

    Do you mind if I have a url so that I could look at it as well?

    Thanks and I hope that helps.

  12. Specules
    Member
    Posted 1 year ago #

    Thank you for replying.

    As I do not have much programming knowledge please be gentle :).

    Right. I have removed <?php twentythirteen_paging_nav(); ?> from index.php, uploded index.php to the location /wp-content/themes/twentythirteen-child but nothing has changed at all.

    Just to make sure... in /wp-content/themes/twentythirteen-child there are only 2 files style.css and index.php. Is that right?

    The url is http://www.productcreationeldorado.com

  13. Specules
    Member
    Posted 1 year ago #

    Ha! I managed to hide the header menu :)

    In header.php I have wrapped the menu in conditional tag.

    <?php if ( !is_front_page() ): ?>
    
    <div id="navbar" class="navbar">
    				<nav id="site-navigation" class="navigation main-navigation" role="navigation">
    					<h3 class="menu-toggle"><?php _e( 'Menu', 'twentythirteen' ); ?></h3>
    					<a class="screen-reader-text skip-link" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentythirteen' ); ?>"><?php _e( 'Skip to content', 'twentythirteen' ); ?></a>
    					<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
    					<?php get_search_form(); ?>
    				</nav><!-- #site-navigation -->
    
    <?php endif; ?>

    I just added <?php if ( !is_front_page() ): ?> before the code above and <?php endif; ?> after.

    Now the widget area :)

  14. Specules
    Member
    Posted 1 year ago #

    The same rule applies to sidebar.php :)

  15. Patricia
    Member
    Posted 1 year ago #

    hi! i need to remove the header nav bar in fourteen. i already bombed my blog 'guessing', so can you tell me where to put this code in fourteen? thanks.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.