Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8968081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:23:24+00:00 2026-06-15T17:23:24+00:00

I’m currently setting up a WordPress site, using this template from ThemeForest, and here

  • 0

I’m currently setting up a WordPress site, using this template from ThemeForest, and here is the live preview of what I’m currently working on (which now should be working – please let me know if it’s not working).

I configured the CSS so the left border when hovered would be the light gray color. Then, when the link was clicked on, the left border would then be the blue color I selected.

As shown below, the main problem I’m having with the navigation is in the CSS. The Portfolio link (Portfolio Section in picture) still has the selected class being applied, along with the internal unordered list item. I would like to have it look like the Blog Section in the picture, where the Blog link no longer applies the selected class item.

I asked the creator of the template why this was occurring; his response was there needs to be another link below that contained the title attribute ‘allportfolio’ so it would work properly. I tried adding this attribute to the main Portfolio link, but then closed the list completely.

Portfolio Section - has two list items with CSS class selected applied and Blog Section - only one list item with CSS class selected applied

When the menu is created, the browser creates the Portfolio selection the following way in HTML:

<ul class="main-menu" id="menu-main-menu">
    <li class="parent selected" id="menu-item-1172">
       <p><a href="http://localhost/portfolio/" style="color: rgb(57, 57, 57);">Portfolio</a></p>
    <div>
       <ul class="sub-menu">
           <li class="menu-item" id="menu-item-1158"><p><a data-filter="website-design" data-category="true" href="#">Website Design</a></p></li>
           <li class="menu-item" id="menu-item-1157"><p><a data-filter="print" data-category="true" href="#">Print</a></p></li>
           <li class="menu-item selected" id="menu-item-1156"><p><a data-filter="motion" data-category="true" href="#">Motion</a></p></li>
           <li class="menu-item" id="menu-item-1155"><p><a data-filter="identity" data-category="true" href="#">Identity</a></p></li>
           <li class="menu-item" id="menu-item-1167"><p><a data-filter="logos" data-category="true" href="#">Logos</a></p></li>
      </ul>
   </div>
   </li>

I tried to so something similar to this answer, but didn’t work since it didn’t seem to include anything within the list item. The following jQuery code below is my attempt:

/*Portfolio links remove selected CSS setting*/
    $('ul#menu-main-menu ul.submenu li p a').click(
        function(){
            $('ul#menu-main-menu li').removeClass('parent selected');
            $(this).addClass('parent menu-item');
    });

I feel stuck because I can’t figure out how to have the HTML look like below (taking out the CSS class ‘selected’ and add the CSS class ‘menu-item’):

<ul class="main-menu" id="menu-main-menu">
    <li class="parent menu-item" id="menu-item-1172">
       <p><a href="http://localhost/portfolio/" style="color: rgb(57, 57, 57);">Portfolio</a></p>
    <div>
       <ul class="sub-menu">
           <li class="menu-item" id="menu-item-1158"><p><a data-filter="website-design" data-category="true" href="#">Website Design</a></p></li>
           <li class="menu-item" id="menu-item-1157"><p><a data-filter="print" data-category="true" href="#">Print</a></p></li>
           <li class="menu-item selected" id="menu-item-1156"><p><a data-filter="motion" data-category="true" href="#">Motion</a></p></li>
           <li class="menu-item" id="menu-item-1155"><p><a data-filter="identity" data-category="true" href="#">Identity</a></p></li>
           <li class="menu-item" id="menu-item-1167"><p><a data-filter="logos" data-category="true" href="#">Logos</a></p></li>
      </ul>
   </div>
   </li>

UPDATE: @limelights answer seemed to work, but I found some jQuery that affects the link hover effects on the website and wasn’t sure if that was the reason the answer to the code wasn’t working is in the scripts.js file of the WordPress template

/* Links roll over effect */
    $('a').each(function(){
        if(!$(this).data('filter') && !$(this).parent().parent().parent().hasClass('pagination'))
            $(this).hoverFadeColor();
    })

Also, I’m very close to what I want to accomplish, using this code to finally keep the internal links open:

/*Portfolio links remove selected CSS setting*/
    $('ul#menu-main-menu li div ul.sub-menu:first li.menu-item p a').click(
        function(){
            $('ul#menu-main-menu > li').removeClass('selected');
            $('ul#menu-main-menu > li').css({'color' : '#222'}).addClass('menu-item');
            $('ul#menu-main-menu li div:first').show();
        });

But, what it’s still doing (as seen below) is that it still has the text chosen like the selected text.

selected text still applied to main menu list link, though the class was removed

Any help is greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:23:25+00:00Added an answer on June 15, 2026 at 5:23 pm

    I did a small change in your css and added some jquery functions into your html page as follows:

    CSS change:

    Find line number 67 in your custom.css and replace the coding as follows:

    /*Turns link background white and removes border on the left at hover*/
    .Light #menu ul.main-menu > li:hover > p > a {
       background:#FFF;
       border-left:6px solid #F0F0F0;
    }
    

    This above one replace into

    /*Turns link background white and removes border on the left at hover*/
    .Light #menu ul.main-menu > li:hover > p > a {
       background:#FFF;
       /*border-left:6px solid #F0F0F0;*/
    }
    

    Adding Jquery function in some where of your theme header or footer file like as follows,

    <script type="text/javascript">
    $(document).ready(function() {
    $("#menu-main-menu li:first").addClass("selected");
    $("#menu-main-menu li p a").css("border-left","none");
    $("#menu-main-menu li p a").hover(function(){$(this).css("border-left","6px solid #F0F0F0");});
    $("#menu-main-menu li").click(function() {
      $(this).addClass("selected");
    });
    });
    </script>
    

    This above changes are working for me.,To see it in action : http://jsbin.com/ehagal/1

    I think this may help you to resolve your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.