• Hello! I’m building a site using the Modern Portfolio theme for Gensesis and I had disabled the post and page titles for certain pages. However, I DO want the post title & the info (author, date, etc) to appear on the post pages themselves but it seems like those have now gone missing. Here is the code I have in my functions.php file:

    //* Remove the entry title (requires HTML5 theme support)
    add_action( 'get_header', 'remove_titles_from_pages' );
    function remove_titles_from_pages() {
        if ( is_page(array(contact, about, portfolio, services, contact-test) ) ) {
            remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
        }
    }
    
    //* Remove the entry title from portfolio posts(requires HTML5 theme support)
    add_action( 'get_header', 'remove_titles_single_posts' );
    function remove_titles_single_posts() {
        if ( is_single(array(watchfire, pyramid, general, first, msi, meeting-maker, keurig, vx, spaceclaim, remax, champ, vistagy, gemini, nelco, hanover, swearingen) ) ) {
            remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
        }
    }
    
    //* Customize the entry meta
    add_filter( 'genesis_post_info', 'sp_post_info_filter' );
    function sp_post_info_filter($post_info) {
    if ( !is_page(news) ) {
    $post_info = '[post_date] by [post_author_posts_link] [post_comments]';
    return $post_info;
    }
    }

    Is something here not allowing my post titles & info to show up? Here is a sample post page where you can see the missing info:

    https://www.haleymistlerdesign.com/uncategorized/test-post-2/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Is that the exact code you are using? The array values are not valid and are probably not working as intended. Try wrapping the slugs in quotes.

    Thread Starter hmistler

    (@hmistler)

    Yes, it is the exact code. I followed these instructions:

    https://wpsites.net/web-design/remove-titles-specific-conditions/

    and the code does remove the titles where I wanted it to, so I think it’s working correctly I just want to be able to see my post titles and info on the actual post pages themselves.

    Typing strings in without quotes is not valid php syntax, they need to be wrapped.
    For example:
    array(contact, about, portfolio, services, contact-test)

    Should be:
    array('contact', 'about', 'portfolio', 'services', 'contact-test')

    Thread Starter hmistler

    (@hmistler)

    Ah I see what you mean – thanks, that worked! I have the titles of the posts, the only thing now is that the entry meta is still not showing up on the posts. My code is this:

    //* Customize the entry meta in the entry header
    add_filter( 'genesis_post_info', 'sp_post_info_filter' );
    function sp_post_info_filter($post_info) {
    
    	$post_info = '[post_date] by [post_author_posts_link] [post_categories] [post_comments]';
    	return $post_info;
    
    }

    Well the meta is actually printing out, but your theme stylesheet has it hidden on line 1477:

    .entry-meta {
    	display: none;
    	clear: both;
    	color: #888;
    	font-size: 16px;
    	font-size: 1.6rem;
    }
    Thread Starter hmistler

    (@hmistler)

    oh! Makes sense. I just changed the CSS and now it’s back. Thank you for taking the time to look into this for me; I’ve learned a bit more about this now! Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Entry title & info missing from my posts’ is closed to new replies.