ThemeShaper Forums » Thematic

[closed]

Removing the drop down menu using filtering?

(11 posts)
  • Started 5 years ago by nath
  • Latest reply from Karaviro
  • This topic is resolved
  1. nath
    Member

    Hello Folks,

    Just wondering whether it is possible to remove the drop down function of the menu, whilst keeping the horizontal layout.

    I am trying to create a menu with two links, and no sub pages (the portfolio pages in my case) (the normal drop down bits)

    Is it possible to filter those functions out? I have tried the copying and pasting the code from: http://themeshaper.com/thematic-09-released/ but to no avail! (it is in fact still in the functions.php in the child theme. The other filters appear to work fine. (side bar and comments removal along with the edited meta data)

    The site in question is: http://www.yafle.co.uk

    I think i could probably achieve it by editing the index.php but i got the impression that the best practice is to use filters. (Which so far has been much easier!)

    As you may have guessed I am very new to Thematic (and in fact wordpress) and although i know a bit of html and css, php is a bit over my head! Thanks for all the snippets of code.

    Any help would be much appreciated...

    Thanks, nath

    Posted 5 years ago #
  2. Hi Nath,

    the mentioned code will only remove the fancy stuff around the menu (keep it in your functions.php). The CSS functionality will remain. To remove the CSS dropdowns add the following code to your child theme's style.css:

    .sf-menu li ul {
        display:none;
    }

    Cheers,

    Chris

    Posted 5 years ago #
  3. nath
    Member

    Hi Chris

    Amazing, it works and was super simple! - I've been scratching my head for a while over that. Thanks for explaining it as well as giving the code, always useful to know what it's doing. I had assumed the drop downs were part of the thematic code rather than CSS and was looking in the wrong place!

    Thanks again

    Posted 5 years ago #
  4. You can't just hide the links, that is search spam.

    function remove_thematic_actions() {
    
        remove_action('thematic_header','thematic_access',9);
    
    }
    add_action('init','remove_thematic_actions');
    Posted 5 years ago #
  5. nath
    Member

    Hi Andy, thanks for the help.

    That partly works but removes all the links menu not just the drop downs!

    Is there any way to show just the parent pages using the remove functions? (as I don't want to search spam...)

    thanks...

    Posted 5 years ago #
  6. Andy .. Sorry .. you can argue that keeping the sub-menus hidden might not be the best solution. That's fine. But the hidden text is not unrelated to the website and therefore this is definitely not spamdexing!

    Cheers,

    Chris

    Posted 5 years ago #
  7. I've used:

    .sf-menu li ul {
        display:none!important;
    }

    It works fine for me.

    Posted 5 years ago #
  8. Jamie Mitchell
    Member

    Works a charm.

    but don't forget to filter the head scripts for the dropdowns too.

    // Filter away the default scripts loaded with Thematic
    function childtheme_head_scripts() {
        // Abscence makes the heart grow fonder
    }
    add_filter('thematic_head_scripts','childtheme_head_scripts');
    Posted 4 years ago #
  9. New here, was just looking for ways to cut down on loading time by removing unnecessary scripts for my build. The filtering method was exactly what I was looking for. Thanks Jamie!

    Posted 4 years ago #
  10. Found another way to do it simply with the supplied functions.php file. Posted here.

    Posted 4 years ago #
  11. With the code snipet from dannydamnboy in my style.css
    and the filter from Jamie Mitchell in the functions.php
    of my childtheme
    it worked, thank you guys

    i hope this is the clean way ;)

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.