WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Remove Home Link from Responsive Theme (5 posts)

  1. alex1996arm
    Member
    Posted 1 year ago #

    I would like to remove the "home" menu item that I cannot remove using the menu page in wordpress. I am using the theme "responsive"

    Thanks,
    Alex

  2. Marco Milesi
    Member
    Posted 1 year ago #

    Remove the related code in its template file (usually header.php)...

  3. alex1996arm
    Member
    Posted 1 year ago #

    <?php
    
    // Exit if accessed directly
    if ( !defined('ABSPATH')) exit;
    
    /**
     * Header Template
     *
     *
     * @file           header.php
     * @package        Responsive
     * @author         Emil Uzelac
     * @copyright      2003 - 2012 ThemeID
     * @license        license.txt
     * @version        Release: 1.0
     * @filesource     wp-content/themes/responsive/header.php
     * @link           http://codex.wordpress.org/Theme_Development#Document_Head_.28header.php.29
     * @since          available since Release 1.0
     */
    ?>
    <!doctype html>
    <!--[if lt IE 7 ]> <html class="no-js ie6" <?php language_attributes(); ?>> <![endif]-->
    <!--[if IE 7 ]>    <html class="no-js ie7" <?php language_attributes(); ?>> <![endif]-->
    <!--[if IE 8 ]>    <html class="no-js ie8" <?php language_attributes(); ?>> <![endif]-->
    <!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" <?php language_attributes(); ?>> <!--<![endif]-->
    <head>
    
    <meta charset="<?php bloginfo('charset'); ?>" />
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    
    <title><?php wp_title('|', true, 'right'); ?><?php bloginfo('name'); ?></title>
    
    <link rel="profile" href="http://gmpg.org/xfn/11" />
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <?php wp_enqueue_style('responsive-style', get_stylesheet_uri(), false, '1.5.9');?>
    
    <?php wp_head(); ?>
    </head>
    
    <body <?php body_class(); ?>>
    
    <?php responsive_container(); // before container hook ?>
    <div id="container" class="hfeed">
    
        <?php responsive_header(); // before header hook ?>
        <div id="header">
    
            <?php if (has_nav_menu('top-menu', 'responsive')) { ?>
    	        <?php wp_nav_menu(array(
    				    'container'       => '',
    					'fallback_cb'	  =>  false,
    					'menu_class'      => 'top-menu',
    					'theme_location'  => 'top-menu')
    					);
    				?>
            <?php } ?>
    
        <?php responsive_in_header(); // header hook ?>
    
    	<?php if ( get_header_image() != '' ) : ?>
    
            <div id="logo">
                <a href="<?php echo home_url('/'); ?>"><img src="<?php header_image(); ?>" width="<?php if(function_exists('get_custom_header')) { echo get_custom_header() -> width;} else { echo HEADER_IMAGE_WIDTH;} ?>" height="<?php if(function_exists('get_custom_header')) { echo get_custom_header() -> height;} else { echo HEADER_IMAGE_HEIGHT;} ?>" alt="<?php bloginfo('name'); ?>" /></a>
            </div><!-- end of #logo -->
    
        <?php endif; // header image was removed ?>
    
        <?php if ( !get_header_image() ) : ?>
    
            <div id="logo">
                <span class="site-name"><a href="<?php echo home_url('/'); ?>" title="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>" rel="home"><?php bloginfo('name'); ?></a></span>
                <span class="site-description"><?php bloginfo('description'); ?></span>
            </div><!-- end of #logo -->  
    
        <?php endif; // header image was removed (again) ?>
    
    				<?php wp_nav_menu(array(
    				    'container'       => '',
    					'theme_location'  => 'header-menu')
    					);
    				?>
    
                <?php if (has_nav_menu('sub-header-menu', 'responsive')) { ?>
    	            <?php wp_nav_menu(array(
    				    'container'       => '',
    					'menu_class'      => 'sub-header-menu',
    					'theme_location'  => 'sub-header-menu')
    					);
    				?>
                <?php } ?>
    
        </div><!-- end of #header -->
        <?php responsive_header_end(); // after header hook ?>
    
    	<?php responsive_wrapper(); // before wrapper ?>
        <div id="wrapper" class="clearfix">
        <?php responsive_in_wrapper(); // wrapper hook ?>

    Can't seem to find it

  4. Emil Uzelac
    Theme Review Admin
    Posted 1 year ago #

    That's not really needed and never edit parent theme files if you're not doing this in form of a child theme. Please create a custom menu instead and include only items that you really need, where you can exclude home page easily.

    See: http://dannybrown.me/2010/10/23/create-custom-menu-wordpress/

    Thanks,
    Emil

  5. alex1996arm
    Member
    Posted 1 year ago #

    Thanks Guys, Really

Topic Closed

This topic has been closed to new replies.

About this Topic