1. PROMO Subscribe our All Access Pass @ 75% OFF & access all our 16+ premium Divi extensions: Divi Block Pro, Carousel Toolkit, etc.LEARN MORE
Dismiss Notice
NEW Divi.Help Pro Carousel AI Toolkit - Magically turn your Divi design into carousel, simply by using our online toolkit. No plugins needed. Now it works with Divi 5 as well!Try our carousel AI toolkit
BEST Divi Block - A revolutionary drag & drop tool to easily mix & match 960+ premade blocks (Light & Dark) to kick start your Divi site design. Special module designs are included as well. Also newly added AI generator & color. Now it works with Divi 5 as well!
Learn More About Divi BlockFree Version ~ 340+ Free Blocks

Solved How can I style variables?

Discussion in 'Free Divi Community Forum' started by oida666, Aug 13, 2024.

  1. oida666

    oida666 New Member

    I use variables on my site so that, for example, the telephone number is in a uniform format everywhere.
    Currently I use code snippets that I include in the functions.php file. Is there a way to style them and, for example, give them an individual color or change the size?


    The code:
    function telefon_shortcode() {
    $telefonnummer = get_theme_mod('meine_telefonnummer', 'Standard Telefonnummer');
    return "<p>+49 911 977 912 40</p>";
    }
    add_shortcode('telefon', 'telefon_shortcode');

    I would be pleased to receive an answer.
     
    1. PRO MEMBER PERKS Divi Ultimate Archive Plugin - Tons of elegant premade sidebar styles to choose from for your Divi site:Learn More
  2. Divi.Help

    Divi.Help Administrator
    Staff Member

    You may try the below amended shortcode:
    Code:
    Log In or Sign Up to view this code.
    And to set the color, you may use shortcode like this: [telefon color="#333333"]