• Resolved gponym

    (@gponym)


    I want to use style.css to suppress display of the so-called entry-title on all pages, or at least just on the Home page for now.

    The following CSS fails–i.e., the word “Home” still appears. User error, doubtless, but I can’t see how to fix it. Any ideas appreciated.

    .home h1.entry-title { display:none; }

    Here is the page source excerpt from the actual home page taken after the above CSS was added to child style.css. (This home page has no tricks; it is a stock twentysixteen “Page” with title and body text and a featured image. That featured image falls just below the excerpted HTML shown here).

    body class="home page-template-default page page-id-4 logged-in admin-bar no-customize-support wp-custom-logo">
    ...
    <div id="content" class="site-content">
    
    <div id="primary" class="content-area">
    	<main id="main" class="site-main" role="main">
    		
    <article id="post-4" class="post-4 page type-page status-publish has-post-thumbnail hentry">
    	<header class="entry-header">
    		<h1 class="entry-title">Home</h1>	</header><!-- .entry-header -->

    ____
    I’m using parent theme twentysixteen theme just setup this week.

    I’m using a child theme of my own with just a few basic mods so far, all done with dashboard prior today’s issue.

    I have proven that child style.css is getting loaded and utilized (I just changed some <p> text to green).

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Please provide a link to a page on your site where we can see this. Thanks.

    try removing the h1 from your css. So

    .home .entry-title (
    display: none;
    }

    There may also be something overriding it somewhere so try

    .home h1.entry-title { display:none !important; }

    Thread Starter gponym

    (@gponym)

    Steve:

    The site is not published, else I’d have shared a link earlier. a I’m working on bluehost which provides a “temp.domains” scratchpad URL. Are those URLs both publicly shareable and secure to do so?

    Thread Starter gponym

    (@gponym)

    Luis, thanks. I tried both without luck. Each time after uploading style.css to the temp site provided by bluehost, I log out of bluehost, then log back in, and then log back in to WordPress.

    The CSS may be just fine. I can’t be certain I’m not being stymied by the potentially several caches, and I don’t know where all the caches might be besides at bluehost and at my browser. I’ve cleared the browser cache (Chrome) and restarted it but that did not help.

    At this point I must stop for at least 48 hours. I’ll try to figure out how to set the caching parameters in the admin menu provided by bluehost.

    If you have any other ideas, thanks in advance for sharing.

    My child theme has only two files: style.css and functions.php. Here are their complete contents, downloaded just now from the site:

    – style.css –

    /*
    Theme Name:  Twenty Sixteen Child
    Description: Twenty Sixteen Child Theme
    Author:  gp
    Template: twentysixteen
    Version: 1.0.0
    License: GNU General Public License v2 or later
    License URI: https://www.gnu.org/licenses/gpl-2.0.html
    Tags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
    Text Domain: twentysixteen-abchild
    */
    
    /* Test inclusion of this style sheet */
    p { color: brown; }
    
    .home h1.entry-title { display:none !important; }
    

    – functions.php –

    <?php
    /*
     gp 1802xx  load child and parent stylesheets
    */
    function my_theme_enqueue_styles() {
    
        $parent_style = 'twentysixteen-style';
    
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style ),
            wp_get_theme()->get('Version')
        );
    }
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    ?>

    Are those URLs both publicly shareable and secure to do so?

    Most likely, yes. Try copying the link and viewing it in a browser window.

    Thread Starter gponym

    (@gponym)

    Luis:

    Success with the following:

    /* suppress entry title on homepage */
    .home .entry-title { display:none !important; }

    I discovered how to adjust the Endurance cache auto-installed by Bluehost to (supposedly) not cache: set to level 0. I do not yet know if this works as expected but, for whatever reason, I was able to prove the above code works this morning.

    Many thanks.

    Thread Starter gponym

    (@gponym)

    Oops, have now marked as resolved.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Need CSS help – suppress entry-title on pages’ is closed to new replies.