admin管理员组

文章数量:1406913

I would like to apply two different styles for entry-title

meaning i.e. "my services: this big"

"my services:" should appear with default font size "This Big" should appear with bigger font size detection char for bigger font would be ":" so if there is a ":" in title, everything afterwards should be xy bigger

I tried for hours already in functions.php, I am to stupid thanks for help

I would like to apply two different styles for entry-title

meaning i.e. "my services: this big"

"my services:" should appear with default font size "This Big" should appear with bigger font size detection char for bigger font would be ":" so if there is a ":" in title, everything afterwards should be xy bigger

I tried for hours already in functions.php, I am to stupid thanks for help

Share Improve this question asked Nov 17, 2019 at 14:29 U2 PasU2 Pas 1 1
  • I found this in my content-page.php, will try to edit: <?php if ( the_title( '', '', false ) && siteorigin_page_setting( 'page_title' ) ) : ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php endif; ?> – U2 Pas Commented Nov 17, 2019 at 18:32
Add a comment  | 

1 Answer 1

Reset to default 0

ok found out - added this to my content-page.php maybe not nice, but works for now...

    <?php $pieces = explode(':', the_title( '', '', false ), 2 ); if (2 == count($pieces)) : ?>
        <h1 class="entry-title"><span><span style="font-size: 24px;"><?php print $pieces[0]; ?>: </span><span><?php print $pieces[1]; ?></span></span></h1>
    <?php else : ?>
        <h1 class="entry-title"><?php the_title(); ?></h1>
    <?php endif; ?>

本文标签: reformat entrytitle with two different styles