• Resolved Badeyes

    (@badeyes)


    Hi all

    I’m trying to modify the following if statement with the output from the get_theme_mod but having no luck, the current one I’m using is:

    <?php if( $thePriority_settings[‘social_title’] != ” ) : ?>
    <?php
    echo $thePriority_settings[‘socialTitle’];
    ?>
    <?php endif; ?>

    how do I change it to look for the control output socialTitle in my customizer?

    cheers

    Geof

Viewing 4 replies - 1 through 4 (of 4 total)
  • What is the output of var_dump( $thePriority_settings )? Looking at the Codex, get_theme_mod() returns a string instead of an array.

    Thread Starter Badeyes

    (@badeyes)

    Hi Stephen

    the output is text from a textbox control.

    I’m not familiar enough with php to quite understand what you mean.

    cheers

    Geof

    Can you post the complete code you’re using to Pastebin and post the link here?

    Thread Starter Badeyes

    (@badeyes)

    I actually figured it out, I used:

    <?php if( get_theme_mod(‘socialTitle’) ): ?>
    <?php
    echo get_theme_mod(“socialTitle” , “”);
    ?>
    <?php endif; ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘If statements and using get_theme_mod’ is closed to new replies.