WordPress.org

Ready to get started?Download WordPress

Forums

Customizr
Apostophes showing up strangely (10 posts)

  1. CitizenOverload
    Member
    Posted 8 months ago #

    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!

  2. CitizenOverload
    Member
    Posted 8 months ago #

    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).

  3. rdellconsulting
    Member
    Posted 8 months ago #

    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?

  4. CitizenOverload
    Member
    Posted 8 months ago #

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

  5. rdellconsulting
    Member
    Posted 8 months ago #

    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?

  6. ElectricFeet
    Member
    Posted 8 months ago #

    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.

  7. medil
    Member
    Posted 8 months ago #

    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

  8. ElectricFeet
    Member
    Posted 8 months ago #

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

  9. nikeo
    Member
    Theme Author

    Posted 8 months ago #

    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!

  10. ElectricFeet
    Member
    Posted 8 months ago #

    @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 :-)

Reply

You must log in to post.

About this Theme

About this Topic