body class

This topic contains 17 replies, has 4 voices, and was last updated by  Strong Coffee 9 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: , ,

  • Author
    Posts
  • #21949

    Strong Coffee
    Full Member
    Post count: 124

    The plugin is adding the body class .geodir-x to all my pages instead of just pages that use GeoDirectory. This is causing some styling conflicts. Is there a way for the plugin to add that class to only the template pages used in GeoDirectory?

    #21966

    Guust
    Moderator
    Post count: 29970

    All your pages can use some GD features, for example GD widgets, so it might be necessary to have that for those.
    But I’ll get the others to look at your topic too.

    #22005

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    what is being affected? what else would be using that class?

    Stiofan

    #22012

    Guust
    Moderator
    Post count: 29970

    Nothing else I think, every widget would have its own styling anyway I would think, but I just thought I’d ask you too.

    #22070

    Strong Coffee
    Full Member
    Post count: 124

    The one I’m having issues with is:

    .geodir-x ul {
    list-style: none;
    }

    I can force it back to normal by going:

    ul {
    list-stye:disc !important;
    }

    but then that changes the styling for GeoDirectory lists as well.

    #22081

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    I guess you are using GDF, that adds geodir_custom_posts to all page’s body classes regardless if it’s a GD page or a blog page or whatever…

    It’s not difficult though to add a new custom body class only to all GD pages.

    http://codex.wordpress.org/Plugin_API/Filter_Reference/body_class

    Adding this to your theme’s functions.php file should do it.

    
    
    // Apply filter
    add_filter('body_class', 'gd_body_classes');
    
    function gd_body_classes($classes) {
            if (geodir_is_geodir_page()) { $classes[] = 'this_is_a_gd_page';
            return $classes;}
    }

    Let us know,

    Thx

    #22083

    Strong Coffee
    Full Member
    Post count: 124

    Perfect. Thanks.

    #32588

    Strong Coffee
    Full Member
    Post count: 124

    Hi. I am having the same issue on another one of my sites that uses GeoDirectory and the code you gave me doesn’t work anymore. I am running a newer version of GeoDirectory on the site so that might be the reason?

    #32603

    Paolo
    Site Admin
    Post count: 31206

    hi,
    I just re-tested and works like it should.

    The only reason that wouldn’t make it work is that it’s not being copied correctly or pasted in the wrong place.

    It should be placed in your active theme functions.php.

    Let us know,

    Thx

    #32640

    Strong Coffee
    Full Member
    Post count: 124

    I have it placed in my child theme functions.php but no change.

    #32642

    Paolo
    Site Admin
    Post count: 31206

    please provide link and wp admin credentials or we won’t be able to assist.

    Thx

    #32643

    Strong Coffee
    Full Member
    Post count: 124
    This reply has been marked as private.
    #32734

    Paolo
    Site Admin
    Post count: 31206

    I see the class???

    Please see image attached.

    Thanks I’ll set this as solved.

    #32738

    Strong Coffee
    Full Member
    Post count: 124
    This reply has been marked as private.
    #32739

    Strong Coffee
    Full Member
    Post count: 124
    This reply has been marked as private.
Viewing 15 posts - 1 through 15 (of 18 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount