• Resolved coloradoskiier

    (@coloradoskiier)


    I just upgraded Vega to the latest version (2.2.3). I’m only using 2 icon columns on the home page. Prior to the upgrade, each column took up 50% of the available space. Now they’re both squeezed into the middle and are too narrow. I inspected the code and noticed they’re both offset by 3 CSS grid columns, which they weren’t before.

    Was that an intentional change in the latest version of Vega? And if so, what’s the recommended way to restore the old behavior where the columns stretch to fill the space if there are less than four columns?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author lyrathemes

    (@lyrathemes)

    Thanks for trying out Vega, I am happy to assist. Would you be able to share your URL with us?

    Thread Starter coloradoskiier

    (@coloradoskiier)

    https://www.inclinetechnical.com

    If you scroll down to the “What We Do” section, you’ll see the columns are narrow and have gaps on the left and right. Prior to upgrading, each of these columns took up 50% of the available page width.

    Theme Author lyrathemes

    (@lyrathemes)

    You need to update this function.

    Right now:

    function vega_wp_get_col_class($n){
        switch($n){
            case 1: return 'col-xs-4 col-xs-offset-4'; break;
            case 2: return 'col-sm-3 col-sm-offset-3' . '|' . 'col-sm-3'; break;
            case 3: return 'col-sm-4|col-sm-4|col-sm-4'; break;
            case 4: return 'col-md-3 col-sm-6|col-md-3 col-sm-6|col-md-3 col-sm-6|col-md-3 col-sm-6'; break;
            case 5: return 'col-sm-2 col-sm-offset-1|col-sm-2|col-sm-2|col-sm-2|col-sm-2'; break;
            case 6: return 'col-sm-2 col-xs-6|col-sm-2 col-xs-6|col-sm-2 col-xs-6|col-sm-2 col-xs-6|col-sm-2 col-xs-6|col-sm-2 col-xs-6'; break;
        }
    }

    Updated:

    function vega_wp_get_col_class($n){
        switch($n){
            case 1: return 'col-xs-4 col-xs-offset-4'; break;
            case 2: return 'col-sm-6' . '|' . 'col-sm-6'; break;
            case 3: return 'col-sm-4|col-sm-4|col-sm-4'; break;
            case 4: return 'col-md-3 col-sm-6|col-md-3 col-sm-6|col-md-3 col-sm-6|col-md-3 col-sm-6'; break;
            case 5: return 'col-sm-2 col-sm-offset-1|col-sm-2|col-sm-2|col-sm-2|col-sm-2'; break;
            case 6: return 'col-sm-2 col-xs-6|col-sm-2 col-xs-6|col-sm-2 col-xs-6|col-sm-2 col-xs-6|col-sm-2 col-xs-6|col-sm-2 col-xs-6'; break;
        }
    }

    I would suggest creating a child theme and adding this in the child theme functions.php so your changes are not overwritten by a theme update.

    Let me know if you have any questions and I’d be happy to help.

    Thread Starter coloradoskiier

    (@coloradoskiier)

    Thanks. I appreciate the quick response! (And that did fix the problem. I did it with a child theme as you suggested.)

    Thread Starter coloradoskiier

    (@coloradoskiier)

    Just a suggestion… since it’s recommended, as you said, to make edits to Vega with child themes, it would be nice to include support in Vega for overriding “required” files (the ones included using the ‘require’ directive in functions.php).

    The file “includes/wp_bootstrap_navwalker.php” is a good example. I had to edit that file to make the top-level links in my drop-down menus clickable. I added an “includes” folder to my child theme and made a copy of the file there, but it was ignored by Vega because Vega’s functions.php uses get_template_directory() to include the file. The get_template_directory() function returns the parent directory, not the child. So I had to edit functions.php in the parent theme and change get_template_directory() to get_stylesheet_directory().

    It’s not a huge problem, but it would be nice if there was a more elegant, built-in way to handle situations like that.

    Theme Author lyrathemes

    (@lyrathemes)

    Thanks for writing back! I’ve made a note of this and it will be taken care of in the next theme update.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Icon column widths in latest version (2.2.3)’ is closed to new replies.