Jump to content


Photo

Disable The Social Menu In The Main Menu On Certain Pages. Is It Possible?


  • Please log in to reply
1 reply to this topic

#1 maikman

maikman

    Member

  • MD Customer
  • PipPip
  • 21 posts

Posted 03 January 2017 - 07:18 PM

Hi guys,

 

Is there any way to disable the social menu in the Main Menu on certain pages?

 

Thanks!

 

Maik



#2 Alex

Alex

    Kolakube Staff

  • Kolakube Admin
  • 3,484 posts

Posted 04 January 2017 - 08:11 PM

Hey Maik,

 

There's not a clean way to remove it without adjusting templates, but we can write CSS to hide it on individual pages. I made a note to consider an easier way to filter it out with a child theme for later.

 

First, we need to determine which pages to hide the social media menu on. If you inspect the page and look at the <body> classes added to the document, we can find a unique class name so we can target just that individual page with CSS (see screenshot).

 

You'll notice in the screenshot there are a lot of classes to choose from. To target this page only, I grabbed the "postid-72384" class (those numbers are the unique page ID) which we can add to our child theme's style.css file to hide the social icons like so:

.postid-72384 .menu-social {
    display: none;
}

You can do this on multiple pages by repeating the same process and adding to the code like so:

.postid-XXXXX .menu-social,
.postid-72384 .menu-social {
    display: none;
}

Let me know if you need any further clarification, but this should do the trick!


- Alex
Check out the Kolakube blog or follow me on Twitter.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users