WordPress.org

Support

Support » Themes and Templates » Page classes

Page classes

  • chrispink
    Member

    @chrispink

    Two pages, one the home page and another, both use the default page template one gets the class ‘grid’ the other the class ‘singular’.

    The one with ‘singular’ shows the featured image 72px lower than the other.

    Rather than hacking the theme what causes this difference in page classes?

    the full selector is ; .full-width.singular .site-content .hentry.has-post-thumbnail

    and changing this
    <body class=”full-width grid”>
    to this
    <body class=”full-width singular”>

    invokes a -72px padding on the article container

    in fact there are a number of issues with using a featured image on the home page, especially when viewing on <600px devices. What makes this page different?

Viewing 2 replies - 1 through 2 (of 2 total)
  • @chrispink, obviously, the singular class injection only happens for pages, which are not the front page. You can try to fix ist by replacing the following lines

    if ( is_singular() && ! is_front_page() ) {
    	$classes[] = 'singular';
    }

    with something like this

    if ( is_singular() ) {
    	$classes[] = 'singular';
    }

    in themes/twentyfourteen/functions.php/twentyfourteen_body_classes().

    Kathryn
    Automattic Happiness Engineer

    @zoonini

    in fact there are a number of issues with using a featured image on the home page

    The gap above a feature image when a static front page is set to use the full-width template is actually a bug, which has been reported – the developers are working on it:

    http://core.trac.wordpress.org/ticket/26694

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Page classes’ is closed to new replies.