• I recently installed this theme on https://www.shinylife.co.uk and I absolutely love the look of it. However, on the home page, some of the tiles are uneven, I think it’s because of the different length of the titles of posts. It makes the round images not quite line up and just looks really messy. Is there any way of changing this to be evenly spaced without having to change post titles?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author invictusthemes

    (@invictusthemes)

    Hello myntkat,

    we can add a function to limit numbers of text for the title this way you can add post with any length of title in it

    you can add this to your function.php file

    function custom_title($before = ”, $after = ”, $echo = true, $length = false) { $title = get_the_title();

    if ( $length && is_numeric($length) ) {
    $title = substr( $title, 0, $length );
    }

    if ( strlen($title)> 0 ) {
    $title = apply_filters(‘the_titlesmall’, $before . $title . $after, $before, $after);
    if ( $echo )
    echo $title;
    else
    return $title;
    }
    }

    and update the content.php about line 15 from
    <?php the_title( sprintf( ‘<h3 class=”entry-title”>‘, esc_url( get_permalink() ) ), ‘</h3>’ ); ?>

    to

    <h3 class=”entry-title”>“><?php custom_title(”, ‘…’, true, ’20’); ?></h3>

    make sure if you do this you have an ftp so you can undo any changes you made if you broke something

    thanks

    Theme Author invictusthemes

    (@invictusthemes)

    <h3 class="entry-title"><a href="<?php the_permalink('') ?>"><?php custom_title('', '...', true, '20'); ?></h3> correction for the code to replace

    Thread Starter myntkat

    (@myntkat)

    Hello!
    Thank you for the reply. I added the code as specified, the titles are now shortenend, but the tiles are still uneven. You can have a look at it here:
    https://www.shinylife.co.uk/

    From the second row on, the tiles aren’t evenly spaced anymore.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Uneven tiles’ is closed to new replies.