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.
Hi there,
Ok than. Do you know any decent tutorial on how to properly use and create child themes?
Hi again. I was just checking on you to see how the child theme quest was going.
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.
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.
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.
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(); ?>
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.
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.
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
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 π
The same rule applies to sidebar.php π
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.