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 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 Nov 17 '19 at 18:32

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; ?>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.