WordPress.org

Ready to get started?Download WordPress

Forums

Isolated issue with a special character (4 posts)

  1. campbelson
    Member
    Posted 1 year ago #

    Hello,

    I use special characters such as ê in titles but it is not working on only ONE occasion at a time! I don't even know how to present this issue.
    Here is the link
    You can see near bottom, a gallery of images with (post) titles on them. You will see on one occasion a "fête" and on one occasion a f�te".
    It only causes this discrepancy on my home page (archives, posts are fine), and it does it randomly just before the (...).

    Thanks a lot for your time.

  2. Hi campbelson,

    This by far not the best-case solution, but in order to use accented characters with your current font, you may need to use their HTML Entity equivalents. See: http://www.utexas.edu/learn/html/spchar.html

    I also found a thread that might help you find a solution: http://wordpress.org/support/topic/accent-in-the-title?replies=12

  3. campbelson
    Member
    Posted 1 year ago #

    Hi Drew Jaynes,

    Thanks for your answer!

    I could use HTML equivalents but that would mean changing all titles bearing special characters. And since the issue is only showing on the home page, where I have added code to display post titles, I should maybe get that added code revisited first. After, I should be considering your thread link which mentions theme-related issues.

    Would there be anything wrong with that code?

    <?php if (have_posts()) : ?>
    
            <?php $posts = get_posts('orderby=rand&numberposts=12&cat=4'); foreach($posts as $post) { ?>
    <?php } ?>
    
            <?php $options = get_option('responsive_theme_options'); ?>
    
    <?php while (have_posts()) : the_post(); ?>
    <h1 class="post-title">
     <a href="<?php the_permalink(); ?>"><?php if (strlen($post>post_title)> 24) {
    				echo substr(the_title($before = '', $after = '', FALSE), 0, 24) . '...';}
                                    else {
    				the_title();
    				} ?>
    </a>
     </h1>
    <?php endwhile; ?>
    <?php endif; ?>
  4. $post>post_title

    should be:

    $post->post_title

    Other than that, I'm not sure you need a get_posts() call inside the loop, though that may be another issue altogether and probably isn't related to the character encoding on your site. Perhaps somebody else has more experience working with foreign character sets.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags