logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$15
Filtering menu

Hello,

In the theme i'm working on I have 3 menus.
One menu is filtering :


	<div class="categories">

<?php

$cats = array('show_option_none' => __('Select Category', 'foliogridpro'));
$categories=get_categories($args);
foreach($categories as $category) { ?>
<li><a href="<?php echo get_category_link( $category->term_id )?>" data-filter="<?php echo $category->category_nicename; ?>"><?php echo $category->name; ?></a></li>

<?php } ?>

</ul>
</div>


This Filtering menu display 3 links in a "list-item".

I would like to take one of the 3 links and display it inside one of the 2 other menus :

	
<!-- Add a third menu -->

<!-- Begin third menu #access2 -->
<nav id="access3" role="navigation">
<?php // This is where the menu is added
wp_nav_menu( array('container_class' => 'menu-links',
'theme_location' => 'third', 'fallback_cb' => '') ); ?>
</nav><!-- end of #access3 -->

<!-- end of Add a third menu -->

<!-- Add a second menu -->

<!-- Begin secondary menu #access2 -->
<nav id="access2" role="navigation">
<?php // This is where the menu is added
wp_nav_menu( array('container_class' => 'menu-top',
'theme_location' => 'secondary', 'fallback_cb' => '') ); ?>
</nav><!-- end of #access2 -->

<!-- end of Add a second menu -->



Please have a look at the image attach.
Thanks for your replies.

This question has been answered.

attachment image View Attachment

guillaume guillaume | 06/15/12 at 9:41am Edit

Previous versions of this question: 06/18/12 at 9:28am | 06/18/12 at 9:53am

The experts have suggested, on average, a prize of $1 for this question.

(1) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    06/15/12
    1:04pm
    Arnav Joy says:

    Can you explain some more points about how did you created this menu ,
    I think there is some confusion in this

    or can you share full code and url ?

    • 06/17/12 6:37am

      guillaume guillaume says:

      Hello Arnav, You allready help me with the following code.

      Here is the code for header.php
      The website is not online :



      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

      <html xmlns="http://www.w3.org/1999/xhtml">

      <head>

      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title><?php bloginfo('name'); ?> <?php bloginfo('description'); ?></title>



      <!-- Usual WP META -->

      <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />

      <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
      <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
      <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="<?php bloginfo('atom_url'); ?>" />
      <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

      <!-- CSS -->

      <link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet" type="text/css" media="screen" />



      <!-- WP Head -->
      <?php wp_head(); ?>

      <script type="text/javascript">
      jQuery.noConflict();

      </script>

      </head>

      <body <?php body_class(); ?>>


      <div id="header">

      <div class="blogInfo">

      <?php

      // if header image has been uploaded, display that, else display title and description
      if(of_get_option('ft_custom_logo')!='')

      {

      ?><a href="<?php bloginfo('url'); ?>"><img src="<?=of_get_option('ft_custom_logo');?>" alt="<?php bloginfo('name'); ?> - <?php bloginfo('description'); ?>" /></a><?php

      }

      else

      {

      ?><p><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a><br /><?php bloginfo('description'); ?></p><?php

      }

      ?>

      </div>

      <div class="sayhey"><a href="mailto:mail@heygee.com">say hey !</a></div>
      <div class="stuffing">
      <div class="categories">

      <?php

      $cats = array('show_option_none' => __('Select Category', 'foliogridpro'));
      $categories=get_categories($args);
      foreach($categories as $category) { ?>
      <li><a href="<?php echo get_category_link( $category->term_id )?>" data-filter="<?php echo $category->category_nicename; ?>"><?php echo $category->name; ?></a></li>

      <?php } ?>
      </ul>
      </div>

      <!-- Add a third menu -->


      <!-- Begin third menu #access2 -->
      <nav id="access3" role="navigation">
      <?php // This is where the menu is added
      wp_nav_menu( array('container_class' => 'menu-links',
      'theme_location' => 'third', 'fallback_cb' => '') ); ?>
      </nav><!-- end of #access3 -->

      <!-- end of Add a third menu -->

      <!-- Add a second menu -->


      <!-- Begin secondary menu #access2 -->
      <nav id="access2" role="navigation">
      <?php // This is where the menu is added
      wp_nav_menu( array('container_class' => 'menu-top',
      'theme_location' => 'secondary', 'fallback_cb' => '') ); ?>
      </nav><!-- end of #access2 -->

      <!-- end of Add a second menu -->

      </div>
      </div>
      <div id="foliogrid"></div>




    • 06/18/12 6:20am

      guillaume guillaume says:

      Hello, do you need more infos from me ?
      Anyone as a clue about my question ?

      Thanks

    • 06/18/12 6:22am

      Arnav Joy says:

      Still i am not sure how can i do this , if i do it using jquery then it will be ok?

    • 06/18/12 6:28am

      guillaume guillaume says:

      No problem for using jquery

    • 06/18/12 6:34am

      Arnav Joy says:

      ok i will give it a try and will let you know

    • 06/18/12 11:54am

      Arnav Joy says:

      add following code at the end of header.php

    • 06/18/12 11:56am

      Arnav Joy says:

      Oh Sorry , ignore my previous msg

      add following code at header.php

      after <?php wp_head();?>

      <script>
      jQuery(document).ready(function($) {
      var FirstElement = $('.categories').find('li').eq(2).html();
      var SecondElement = $('#access2').find('li').eq(2).html();
      $('.categories').find('li').eq(2).html(SecondElement);
      $('#access2').find('li').eq(2).html(FirstElement);
      });
      </script>

    • 06/18/12 12:19pm

      guillaume guillaume says:

      Thx Arnav
      but the menu are upside down have a look at the attach image.

      Attached Image

    • 06/18/12 12:25pm

      guillaume guillaume says:

      Ok I use this


      <script>

      jQuery(document).ready(function($) {

      var FirstElement = $('.categories').find('li').eq(2).html();

      var SecondElement = $('#access2').find('li').eq(2).html();

      $('.categories').find('li').eq(2).html(SecondElement);

      $('#access2').find('li').eq(2).html(FirstElement);

      });

      </script>



      and it is working
      Nice one, thanks

    • 06/18/12 12:26pm

      guillaume guillaume says:

      sorry I use this


      <script>



      jQuery(document).ready(function($) {



      var FirstElement = $('.categories').find('li').eq(2).html();



      var SecondElement = $('#access3').find('li').eq(2).html();



      $('.categories').find('li').eq(2).html(SecondElement);



      $('#access3').find('li').eq(2).html(FirstElement);



      });



      </script>



      now it's working.

This question has expired.



Gabriel Reguly, guillaume guillaume voted on this question.



Current status of this question: Completed



Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.