• Resolved danifola

    (@danifola)


    Hi,

    The wpbf theme is really flexible and good to work with.

    I see that on all pages I get classes defined on the body section that are useful. For example for pages I see that I get the page-id-aaa class where aaa is the page id number. I also get another class that goes by the name wpbf-aaa where bbb is the page slug. This is the class I prefer to use.

    But, sometimes, when the page loads I get another name for the class. For instance if my page slug is landing. I should get the class wpbf-landing, instead I see that I have wpbf-4jezynsj7k; or some other rather strange name that I cannot see to have relation to the page.

    Is this a bug or can I somehow solve the issue?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author David Vongries

    (@davidvongries)

    Hi,

    we add a body class to each post/page/cpt that’s wpbf-{post-name}.

    Do you have an example where this happens so I can have a look at this?

    Thanks! ??

    Best,
    David

    Thread Starter danifola

    (@danifola)

    Hi David,

    This is happening on my test page right now.

    The strange thing is that sometimes I get the wpbf-{post-name} correct and sometimes I get 4jezynsj7k or wirjhkdafi. I cannot understand when it shows up correctly, and when not.

    I searched for these two ‘terms’ (4jezynsj7k and wirjhkdafi) in my sql database and I could not find them.

    Hope that helps to try to find the issue.

    Theme Author David Vongries

    (@davidvongries)

    That’s strange.

    Basically, all we do is this:

    // Add wpbf-{post-name} body class on singular.
    if ( is_singular() ) {
    	global $post;
    	$classes[] = 'wpbf-' . $post->post_name;
    }

    This also doesn’t seem to happen on my installations, I just checked a bunch of pages. Worth testing if that still happens when the site is live or with other plugins disabled.

    Best,
    David

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Classes not always defined on html body element’ is closed to new replies.