No page title on blog archives

Community Forums Forums Design Tips and Tricks No page title on blog archives

This topic is: not resolved

This topic contains 13 replies, has 4 voices, and was last updated by  Vejper 2 months, 2 weeks ago.

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #111283

    Vejper
    Member
    Post count: 8

    I wanted to have some content above my default blog entries page so I use this code:

    <?php
     
    //* Template Name: Blog
     
    //* Show page content above posts
    add_action( 'genesis_loop', 'genesis_standard_loop', 5 );
     
    genesis();

    But then I get the page name/title above it also as following example.
    * Page Name
    * Page Content
    * Blog Posts

    And I tried using following code to remove * Page Name

    
    //* Remove page titles site wide (posts & pages) (requires HTML5 theme support)
    remove_action( 'genesis_entry_header', 'genesis_do_post_title' );

    But then all the blog posts titles get removed also wich I don’t want so how can I remove only the page title but not posts titles?

    #111365

    Victor Font
    Participant
    Post count: 70

    You need a custom function in your functions.php file where you can conditionally filter by page ID. Here is the code I use on my sites:

    
    //* Remove page title for a specific page (requires HTML5 theme support)
    //* Change '28' to your page id
    add_action( 'get_header', 'child_remove_page_titles' );
    function child_remove_page_titles() {
    
    	//* 354 =
    	//* 519 = Leadership Framework
    	//* 1149 = Training Registration
    	//* 3545 = Resume/CV
    	//* 4544 = Welcome Back
    	//* 1754 = Plugin Defect Form
    
    	$pages = array( 354,519,1149,1754,3545,4544 );
    	if ( is_page( $pages ) ) {
    		remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    	}
    }
    #111379

    jodzeee
    Participant
    Post count: 216

    I’ve struggled with this in the past and found a variety of ways to do it. I’m still not sure what the “right” or best way is. If I just want to remove titles, I use this plugin:

    http://wordpress.org/plugins/genesis-title-toggle/

    This thread has some links and explanation of when I tried to figure it out. Hopefully it’s helpful.

    http://www.studiopress.com/forums/topic/adding-content-to-top-andor-bottom-of-blog-page/

    • This reply was modified 2 months, 3 weeks ago by  jodzeee.
    • This reply was modified 2 months, 3 weeks ago by  jodzeee.
    #111405

    Vejper
    Member
    Post count: 8

    @vfontjr
    What I see is a code that will do exactly the same thing and remove the titles of all posts in the list on that page anyway aswell as the page title.

    @jodzeee
    Tried that plugin but it does exactly the same as my code that I used already and for the thread you linked me too it doesn’t seem to have any answers about this since the same problem will arise with those plugins.

    • This reply was modified 2 months, 3 weeks ago by  Vejper.
    • This reply was modified 2 months, 3 weeks ago by  Vejper.
    #111417

    jodzeee
    Participant
    Post count: 216

    I guess I’m not entirely sure what you’re trying to accomplish.

    Another way I’ve done what I *think* you’re looking for is with this plugin:

    http://wordpress.org/plugins/posts-in-page/

    Or by using a category archive and adding the intro text there.

    http://sridharkatakam.com/category-archive-headline-intro-text-genesis/

    #111423

    Vejper
    Member
    Post count: 8

    The posts in page plugin will not work.

    What I mean is when I activate so I can have content above the blog posts list I get the following page:

    Page Name
    Content
    Post Title #1
    Post Content #1
    Post Title #2
    Post Content #2

    and so on and I want to remove Page Name but when I do that with either the code or the plugin then all the Post Titles disappear aswell.

    The category archive isn’t really what I want since I have a page named Blog that I use the Blog template for so I have all the blog posts listed there so the category intro text isn’t going to show unless I am on a category archive page.

    I hope I succeeded in making it a little bit more clear what my problem is.

    #111577

    jodzeee
    Participant
    Post count: 216

    I didn’t realize the plugin would affect all titles and not just the page title.

    An easy hack would be to hide the page title using CSS. I tried it on one of mine and it works … it’s H1 and the post titles are H2 so you can target just the page title.

    #111598

    braddalton
    Participant
    Post count: 9735

    Try something like this:

    .page-template-page_blog-php .archive-description {
    display: none;
    }


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #112084

    Vejper
    Member
    Post count: 8

    Got it solver by using this code:

    .post-36 .entry-header {
    	display: none;
    }

    The page is id 36 obviously so thanks for the help but I am still looking for a better and cleaner way of doing this in the template file or something instead so it disappear completely and not even left in the source code, any other suggestions?

    #112090

    braddalton
    Participant
    Post count: 9735

    Try this http://wpsites.net/web-design/remove-titles-specific-conditions/


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #112323

    Vejper
    Member
    Post count: 8

    @braddalton Thanks but once again everything on that page either removes the title from the page and all blog posts listed on that page or none of the titles get removed.

    #112343

    Vejper
    Member
    Post count: 8

    Thanks for trying to help me with this problem but I succeeded in fixing it by remove the content code from my first post and instead used an hook and a function with the content I wanted above all the posts on that page and by doing that eliminating the page title completely :)

    #112345

    braddalton
    Participant
    Post count: 9735

    Th easiest way to do this would be to not add a name to the blog page template.



    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #112346

    Vejper
    Member
    Post count: 8

    Then it the page under page management would just be blank and it wouldn’t be clear what that page was for.

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.