• Resolved lauratraveler

    (@lauratraveler)


    Hi, I’m using the CardView Compact them and I’d like to change the title of the posts to uppercase. How can I do this with CSS? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hey @lauratraveler,

    Normally you’d just add your CSS rules to your theme’s style.css file for example and that would be it (and you probably already tried this). However, WPP widget themes -like Cardview Compact- won’t inherit these styles because they’re self-contained components so we need a different approach. (I know you didn’t ask for this explanation, just giving some context haha).

    If you only want to change the title to uppercase the fastest way to do so would be via PHP (weird, I know). Add this code snippet either to your theme’s functions.php file or via the Code Snippets plugin for example and that should do the trick:

    /**
     * Make popular posts links red in 'Cards' theme.
     *
     * @param  string $additional_styles
     * @param  string $theme_name
     * @return string
     */
    function wpp_additional_css_rules($additional_styles, $theme_name) {
        if ( 'cardview-compact' == $theme_name ) {
            $additional_styles .= '.wpp-cardview-compact li .wpp-item-data .wpp-post-title { text-transform: uppercase; }';
        }
        return $additional_styles;
    }
    add_filter('wpp_additional_theme_styles', 'wpp_additional_css_rules', 10, 2);

    If you have any further questions please let me know.

    Thread Starter lauratraveler

    (@lauratraveler)

    Thank you so much, @hcabrera. It worked! ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change post title styling’ is closed to new replies.