[Resolved] Breadcrumb

Home Forums Support [Resolved] Breadcrumb

Home Forums Support Breadcrumb

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2258336
    Roger

    Hi!

    How to decrease the font size of breadcrumbs? I’m not using Yoast.

    I used a gain with the code below:`

    <?php
    function get_breadcrumb() {
    echo ‘<a href=”‘.home_url().'” rel=”nofollow”>Home</a>’;
    if ( is_category() || is_single() ){
    echo ” » “;
    the_category (‘ • ‘);
    if ( is_single() ) {
    echo ” » “;
    the_title();
    }
    } elseif ( is_page() ) {
    echo ” » “;
    echo the_title();
    }
    }
    get_breadcrumb();
    ?>

    #2258365
    Fernando
    Customer Support

    Hi Roger,

    To do as such, kindly alter your code into something like this:

    <?php
    function get_breadcrumb() {
    echo '<div class="my-breadcrumbs">';
    echo '<a href="'.home_url().'" rel="nofollow">Home</a>';
    if ( is_category() || is_single() ) {
    echo ' » ';
    the_category (' • ');
    if ( is_single() ) {
    echo ' » ';
    the_title();
    }
    } elseif ( is_page() ) {
    echo ' » ';
    echo the_title();
    }
    echo '</div>';
    }
    get_breadcrumb();
    ?>

    I added a div container with a class my-breadcrumbs which we can target through CSS.

    Now, we can modify the font through a CSS like this which you may add in Appearance > Customize > Additional CSS:

    .my-breadcrumbs {
        font-size: 50px;
    }

    Hope this helps!

    #2258371
    Roger

    How to display only Home > Categories

    #2258393
    Fernando
    Customer Support

    You can modify your current code to something like this:

    <?php
    function get_breadcrumb() {
    echo '<div class="my-breadcrumbs">';
    echo '<a href="'.home_url().'" rel="nofollow">Home</a>';
    if ( is_category() || is_single() ) {
    echo ' » ';
    the_category (' • ');
    }
    echo '</div>';
    }
    get_breadcrumb();
    ?>

    Kindly let us know how it goes.

    #2258395
    Roger

    Thank you!

    #2258427
    Fernando
    Customer Support

    You’re welcome Roger!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.