WordPress.org

Ready to get started?Download WordPress

Forums

Add URL Slugs as Body Classes
works in general but not with URLs customized by Permalink Editor plugin (8 posts)

4 stars
  1. outlierdesign
    Member
    Posted 1 year ago #

    Title says it all. It's otherwise great.

  2. Aaron T. Grogg
    Member
    Plugin Author

    Posted 1 year ago #

    Hmm... no reason that it shouldn't work, but I'll check it out!

    Atg

  3. Aaron T. Grogg
    Member
    Plugin Author

    Posted 1 year ago #

    Hmm, on a local WP installation, I got the following body classes:

    With neither plugin activated:
    single single-post postid-1 single-format-standard logged-in admin-bar customize-support

    With just my plugin activated:
    single single-post postid-1 single-format-standard logged-in admin-bar uncategorized hello-world customize-support
    (added uncategorized hello-world)

    With just Permalink Editor activated:
    single single-post postid-1 single-format-standard logged-in admin-bar customize-support
    (same as with neither activated)

    And with both plugins activated:
    single single-post postid-1 single-format-standard logged-in admin-bar uncategorized hello-world customize-support
    (same as with just mine activated)

    What exactly were you expecting, that isn't happening?

    Atg

  4. outlierdesign
    Member
    Posted 1 year ago #

    Hey, thanks for looking into it so quickly. I should have included more detail in my initial post; the title did not actually say it all.

    The particular situation in which body classes are not generated as I'd hoped is this.

    On a few pages I am using the other plugin I mentioned to fake the appearance of a different permalink structure for those pages (for reasons not worth getting into at the moment), e.g. for a page that would have had /all/ for its permalink, I changed it to /books/all/.

    In the above example, your plugin picks up on the "/all/" part of the slug, but it does not pick up on the /books/ part that I added to that page individually using the other plugin.

    My setup is pretty complicated so this may well not be worth your time to look into further. I ended up doing something different anyway. Thanks for the time you took to look into my post, though, and thanks for the plugin.

  5. Aaron T. Grogg
    Member
    Plugin Author

    Posted 1 year ago #

    Okay, got it.

    This is interesting, though, because all my plugin is doing is grabbing the get_bloginfo('url'), removing the domain name, parsing what's left on the "/", and pushing that body class...

    So, this must have something to do with timing, as in, when Permalink Editor customizes the get_bloginfo('url') and when my plugin looks at it.

    You might also be abel to do something like what you're describing via the .htaccess file, but if it isn't something you need anymore, then I'll file this as something to look into later.

    Cheers,
    Atg

  6. Aaron T. Grogg
    Member
    Plugin Author

    Posted 1 year ago #

    PS: If you're satisfied with this, would you mind closing the Topic?

    Thanks,
    Atg

  7. outlierdesign
    Member
    Posted 1 year ago #

    That is helpful to know regarding what your plugin does as well as the timing idea. That does give me ideas. Yeah, it is not something I need addressed anymore though so all's well on my end, thank you.

    I'm happy with how it's been resolved, but for the life of me it appears there is no way for me to officially mark this closed/resolved nor to edit my initial post. I Googled around a bit and it looks like I can't do that because I posted in the Reviews section rather than in Support. But it looks like it's not counting against your plugin's support response rate though, at least.

  8. Aaron T. Grogg
    Member
    Plugin Author

    Posted 1 year ago #

    ha, all's good then, cheers!

    Atg

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.