• Hi there,

    When I’ve been using apostrophes they’ve been showing up as '

    Anything I can do to fix it? It’s done that from the beginning, I haven’t changed any coding as far as I can tell.

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter CitizenOverload

    (@rabbitontherun)

    Apologies, that didn’t work, they show up as & # 0 3 9 ; (I had to space them out because when I put them together then it shows up as an apostrophe. However, on the page, it reads as the above symbols and does NOT convert to an apostrophe).

    Trying to resolve similar over here:
    http://wordpress.org/support/topic/background-32

    Can you be more specific on where you are entering the apostrophe?

    Thread Starter CitizenOverload

    (@rabbitontherun)

    I’m using it on the slider which is on the main page of the website.

    In the above post @electricfeet confirmed that apostrophe cannot be used in Custom CSS, has to be setup in child theme.

    Is that any help?

    You cannot use apostrophes in the slider (this is a bug, in my opinion). You need to use instead the ´ character. Copy and paste it from here.

    The WordPress codex has a function, wp_specialchars_decode() for displaying HTML encoded characters such as the quote.

    For displaying the quote and the apostrophe in the slider, in your child theme, simply wrap the output string in the wp_specialchars_decode() function.

    For the slider, modify parts/class-header-slider.php in your child theme as follows:

    Find the following code:
    
    $text               = esc_textarea(get_post_meta( $id, $key = 'slide_text_key' , $single = true ));
    
    Change it to:
    
    $text               = wp_specialchars_decode(esc_textarea(get_post_meta( $id, $key = 'slide_text_key' , $single = true )));

    Likewise, if you want quotes or apostrophes in the Featured pages text, modify parts/class-content-featured_pages.php in your child theme as follows:

    Find the following code:
    
    <p><?php echo $text;  ?></p>
    
    Change it to:
    
    <p><?php echo wp_specialchars_decode($text);  ?></p>

    Hope that helps!

    Mike

    @medil Thanks!
    @nikeo Would it be possible to correct this in the theme?

    Theme Author presscustomizr

    (@nikeo)

    Any option that is saved into the database has to be sanitize very carrefully in any website, WordPress is not an exception : http://codex.wordpress.org/Data_Validation.
    This is one way to protect the themes against SQL injection (the web is not a safe place!)

    I will think about a solution for some special characters though

    @electricfeet : thanks for the top quality support you do on this forum!

    @electricfeet : thanks for the top quality support you do on this forum!

    Thanks, it’s a learning experience for me.

    p.s. I’ve tagged a few “niclook”s 🙂

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Apostophes showing up strangely’ is closed to new replies.