Support » Fixing WordPress » custom css – text not displayed – maybe syntax error

  • Resolved katkafn

    (@katkafn)


    please help me find a mistake below – the text from “Designed by…” is not displayed on my website
    Thank you in advance

    <?php
    /**
    * This is where you can copy and paste your functions !
    */

    /* Credits – template
    */

    add_filter(‘tc_credits_display’, ‘my_custom_credits’, 20);
    function my_custom_credits(){
    $credits = ‘RNDr. Katarína Frost Nielsen – ITSM&CI’;
    $newline_credits = ”;
    return ‘
    <div class=”span6 credits”>
              <p> · © ‘.esc_attr( date( ‘Y’ ) ).’ ‘.($credits ? $credits : ‘ · Designed by Press Customizr‘).’ ·’.($newline_credits ? ‘<br />· ‘.$newline_credits.’ ·’ : ”).'</p> </div>’;
    }

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @katkafn.

    The code $credits ? $credits : ‘Designed by Press Customizr‘ use a ternary operator. The ternary operator works this way (condition) ? (true return value) : (false return value).

    So you may remove the ternary operator. Something like that:

    return
    '<div class=”span6 credits”>
        <p> · © ' . esc_attr( date( ‘Y’ ) ) . 
      ' · Designed by Press Customizr' 
      . $newline_credits .
      '</p>
        </div>';
    Thread Starter katkafn

    (@katkafn)

    Hi Rahmohn,
    Thanks for fast reply, it works now. I changed code like this:

    .($credits ? $credits : ”).’ · Designed by …etc…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘custom css – text not displayed – maybe syntax error’ is closed to new replies.