0

i use twenty twelve custom theme (palumariosrl.it) but i have a problem. If i try to use on responsive mode the menu not function (can i see only hover menu page and if i click on menu buttom i have a error 404!)

I try to delete custo menu style but nothig resolve. I try to delete the function about wpml but nothing resolve.

//WPML Custom

add_filter( 'genesis_nav_items' , 'flags_selector' , 10 , 2 );
add_filter( 'wp_nav_menu_items' , 'flags_selector' , 10 , 2 );
function flags_selector($menu, $args){
  $args = (array)$args;
  $flags = '';

  if ( $args['theme_location'] != 'primary' )
    return $menu;

  $lang = icl_get_languages('skip_missing=0&orderby=code');
  if( !empty($lang) ) {
    $flags .= '<div id="flags-selector">';
    foreach( $lang as $l ) {
      $flags .= '<div class="flag-item">';
      if( !$l['active'] )
        $flags .= '<a href="' . $l['url']. '">';
      $flags .= '<img src="'. $l['country_flag_url']
                . '" height="12" alt="' . $l['language_code']
                . '" width="18" title="' . $l['translated_name']
                . '" />';
      if ( !$l['active'] )
        $flags .= '</a>';
      $flags .= '</div>';
    }
    $flags .= '</div>';
  }
  return $menu . $flags;
}

I try to remove the custom css about menu but nothing change:

/*-----------------
NAVIGATION MODS
-------------------*/
.main-navigation {/* move menu right and up */
    margin-top: -40px;
    margin-top: -3rem;
    float: right;
}
.main-navigation li {
    margin-top: -40px;
    margin-top: -1rem;
}
.main-navigation a:hover {
    color: #AF9F5D;
}
a:hover {
    color: #AF9F5D;
}
.main-navigation .assistive-text:focus {
    color: #AF9F5D;
}
.main-navigation ul.nav-menu,
.main-navigation div.nav-menu > ul {
    border-bottom:0;
    border-top:0;
}
.main-navigation li a {
        font-family: 'Dosis', sans-serif;
        font-size: 15px;
        border-bottom: 0;
        color: #a8a8a8;
        line-height: 3.692307692;
        text-transform: uppercase;
        white-space: nowrap;
}
.main-navigation li a:hover {
        color: #AF9F5D;
}   
.main-navigation li ul li a:hover {
        background: #4c4c4c;
        color: #ccc;
}   
.main-navigation li ul li a {
        background: #3a3a3a;
        border-bottom: 1px solid #897C45;
        display: block;
        font-size: 11px;
        font-size: 0.785714286rem;
        line-height: 2.181818182;
        padding: 8px 10px;
        padding: 0.571428571rem 0.714285714rem;
        width: 180px;
        width: 12.85714286rem;
        white-space: normal;
}       
.main-navigation a {/*change menu title color*/
    color: #A8A8A8;
}
.entry-content img,
.comment-content img,
.widget img,
img.header-image,
img.wp-post-image {/* remove border lines from menu */
    border-radius:15px;
    box-shadow:0 0 0 rgba(0,0,0,0);
}

.main-navigation .current-menu-item > a,
    .main-navigation .current-menu-ancestor > a,
    .main-navigation .current_page_item > a,
    .main-navigation .current_page_ancestor > a {/* active menu link color */
        color: #897C45;
}

I try to disable transition plugin but not resolve the problem. If i use the defoult theme the problem work without any problem but whit child theme if i click on menu button on responsive i have a 404 error and this url http://palumariosrl.it/%20%3C/a%3E%3C/h1%3E%3Ch2%20class=

This is my header.php

<?php
/**
 * The Header template for our theme
 *
 * Displays all of the <head> section and everything up till <div id="main">
 *
 * @package WordPress
 * @subpackage Twenty_Twelve
 * @since Twenty Twelve 1.0
 */
?><!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) & !(IE 8)]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php wp_head(); ?>
<link href='http://fonts.googleapis.com/css?family=Dosis' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Ropa+Sans' rel='stylesheet' type='text/css'>
<!--LightBox Effect-->
<script type="text/javascript" src="<?php echo get_stylesheet_directory_uri(); ?>/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="<?php echo get_stylesheet_directory_uri(); ?>/js/lightbox.min.js"></script>    
<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(); ?>/css/lightbox.css" rel="stylesheet" />
<?php if (get_the_title()=='Home') { ?>
  <style type="text/css">
footer[role="contentinfo"]{
    border-top: 0 none;
    clear: both;
    font-size: 0.857143rem;
    line-height: 2;
    margin-left: auto;
    margin-right: auto;
    margin-top: 35.7143rem;
    max-width: 68.5714rem;
    padding: 1.71429rem 0;
}
</style>  
<?php } ?>

</head>

<body <?php body_class(); ?>>
<div id="fullscreen"></div>
<div id="page" class="hfeed site">

    <header id="masthead" class="site-header" role="banner">
        <hgroup>
    <div class="logo"><a href="<?php echo esc_url( home_url( '/' ) ); ?>">
    <img src="http://palumariosrl.it/wp-content/uploads/logo.png" alt="Palu Mario Srl" title="Lavorazione legno massello" width="250px" height="64px"></a>  </div>
            <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?> </a></h1>
            <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
        </hgroup>

        <nav id="site-navigation" class="main-navigation" role="navigation">
            <button class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></button>
            <a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a>
            <?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
        </nav><!-- #site-navigation -->

        <?php if ( get_header_image() ) : ?>
        <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" /></a>
        <?php endif; ?>
    </header><!-- #masthead -->

    <div id="main" class="wrapper">

I can't see what is wrong with the mobile menu. I look on old question but nothing resolve my problem. Any ideas?


Hello and thank for reply. The code are the defout code of twenty twelve.

So if i change <?php echo esc_url( home_url( '/' ) ); ?> with <?php get_site_url(); ?> the problem remain.

The 3 point i've delete and the 2 point not necessary. But the problem remain. So if you can see the website on screen less px and if you try to click on menu button you going to 404 page.

  • Please use comments or edit your question with updates. :) – Rarst Feb 25 '15 at 12:59
0

There are a few code edits you might have to do.. So lets go step by step..

  1. Change in the places you use, <?php echo esc_url( home_url( '/' ) ); ?> to get the home page url, you can replace it with <?php get_site_url(); ?> which will get you your site URL.
  2. Next you are using the code of Site Title, <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?> </a></h1> <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2> coz if you arent you can comment this code with <!-- <code> --> tags. IF you are, then you could add the necessary text or use it as,
  3. What is this line of code used for? <a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a> coz its creating some html tag errors, you could comment this out too.

So once you are done with these changes let me know if it worked as you wanted or do you still face any issues.

  • Hello and thank for reply. The code are the defout code of twenty twelve. So if i change <?php echo esc_url( home_url( '/' ) ); ?> with <?php get_site_url(); ?> the problem remain. The 3 point i've delete and the 2 point not necessary. But the problem remain. So if you can see the website on screen less px and if you try to click on menu button you going to 404 page. – skifast Feb 25 '15 at 13:48
  • I am not sure if you are familiar with firebug or element inspectors or developer toold bars.. if you are great, you can check through that.. When your code is getting render on site, it comes as, <hgroup> <div class="logo"><a href=""> <img src="palumariosrl.it/wp-content/uploads/logo.png" alt="Palu Mario Srl" title="Lavorazione legno massello" width="250px" height="64px"></a> </div> <h1 class="site-title"><a href=" &lt;/a&gt;&lt;/h1&gt; &lt;h2 class=" site-description"=""></a></h1><a href=" &lt;/a&gt;&lt;/h1&gt; &lt;h2 class=" site-description"=""> </a></hgroup> – Kelvin Castelino Feb 25 '15 at 13:51
  • So if you see in the code, the tags are not getting closed.. the href part of the anchor is not getting the link.. so you might want to remove the point 2 part of code too.. – Kelvin Castelino Feb 25 '15 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.