Title for posts on frontpage

  • Author
    Posts
  • #42054

    Hi there,

    On frontpage/presentation page I would like to display a title above the posts. The set-up plug-in just offers this option for the columns.
    “Text area 2” isn’t the right solution in this case.

    I tried to change frontpage.php but wasn’t able to find out in which part to add the code.

    Best regards

    Website: www.weltangucker.de

    • This topic was modified 7 years ago by Klaus.
    #42220
    Zed
    Cryout Creations mastermind

    The posts on the frontpage are loaded with
    if ($nirvana_frontposts=="Enable"): get_template_part('content/content', 'frontpage'); endif; ?>
    in frontpage.php, so you’d need to place your title somewhere before that line.


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
    #43728

    Thanks for this answer.
    I tried it with severeal snippets at several places before that line, but I can’t get the expected additional title.

    I have no trouble to place the additional title AFTER the region of desire but not BEFORE!

    Every try to place visible HEadlines before the line I have realy no success. If I do the same after your mentioned line I can have my title below the saction.

    I have really no clue what is wrong…

    Could you write please your answer a little bet more defined, please?

    • This reply was modified 6 years ago by cicci-j.
    • This reply was modified 6 years ago by cicci-j.
    #43807
    Zed
    Cryout Creations mastermind
    		add_filter( 'get_the_excerpt', 'nirvana_custom_excerpt_more',10 );
    	}
    ?> <h3 class="custom-title">Sample title</h3> <!--this is the custom title and the only modification to the code--> <?php 
    if ($nirvana_frontposts=="Enable"): get_template_part('content/content', 'frontpage'); endif; ?>

    You’ll also need a bit of styling depending on how and where you want that title aligned.


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
    #43842

    So the Sample Title appears at the right place. But I cannot amend styling. My idea was to add #custom-title to the existing list in style.css as styling already exists

    Existing CSS

    #front-text1 h2,
    #front-text2 h2,
    #front-text5 h2,
    #front-columns h2,
    {
    display: block;
    float: none;
    margin: 0px auto;
    font-size: 45px;
    line-height: 55px;
    clear: both;
    font-weight: 300;
    }

    amended CSS

    #front-text1 h2,
    #front-text2 h2,
    #front-text5 h2,
    #front-columns h2
    #custom-title h2,
    {
    display: block;
    float: none;
    margin: 0px auto;
    font-size: 45px;
    line-height: 55px;
    clear: both;
    font-weight: 300;

    Unfortunately it doesn’t work. Where am I wrong?

    Website: www.weltangucker.de

    • This reply was modified 6 years ago by Klaus.
    #43853
    Zed
    Cryout Creations mastermind

    You need to pay attention to the id/classname placement. In my example it’s a H3 and it bears the id directly, making the correct identifier h3#custom-title


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
    #43860

    Thank you for helping on Sunday!!

    Sorry but I don’t get it… I tried

    h3#custom-title,
    #front-text1 h2,
    #front-text2 h2,
    #front-text5 h2,
    #front-columns h2 {
    	display: block;
    	float: none;
    	margin: 0px auto;
    	font-size: 45px;
    	line-height: 55px;
    	clear: both;
    	font-weight: 300;
    }

    as well as

    h3#custom-title h3,
    #front-text1 h2,
    #front-text2 h2,

    as well as

    h3#custom-title h2,
    #front-text1 h2,
    #front-text2 h2,
    #front-text5 h2,
    #front-columns h2 {
    	display: block;

    as well as to separate it to

    h3#custom-title h3 {
    	display: block;
    	float: none;
    	margin: 0px auto;
    	font-size: 45px;
    	line-height: 55px;
    	clear: both;
    	font-weight: 300;
    }

    but the custom-title does not change for one single pixel…

    In Firefox console I can adjust font-weight for h3.custom-title but it seems to belong to #pp-afterslider h3 and that is where I get stuck in CSS…

    Website: www.weltangucker.de

    • This reply was modified 6 years ago by Klaus.
    • This reply was modified 6 years ago by Klaus.
    #44183
    Zed
    Cryout Creations mastermind

    Sorry, there was a discrepancy in my previous answer. The example code uses a classname while the styling uses an ID.
    Modify the code to also use ID:
    <h3 id="custom-title">Sample title</h3>


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
    #44333

    Thank you so much @Zed! My Problem is solved!

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

The topic ‘Title for posts on frontpage’ is closed to new replies.