post_title: replace special chars like ??ü in wordpress title
-
There is a static webpage on which the recent wp posts should be displayed. I cannot change the encoding of that webpage. I’m trying to help a friend in germany who has run into serious problems with german Umlaute as he calls it.
Whenever I try to pull the posts:
<?php $recent_posts = wp_get_recent_posts(array( 'numberposts' => 4, // Number of recent posts thumbnails to display 'post_status' => 'publish' // Show only the published posts )); foreach( $recent_posts as $post_item ) : ?> <p><a href="<?php echo get_permalink($post_item['ID']) ?>"><?php echo $post_item['post_title'] ?> </a><br/><?php $post_date = get_the_date( 'd.m.Y' ); echo $post_date;?></p> <?php endforeach; ?>
I end up with messed up titles as long as the post title contains special chars like ??ü.
I had no luck with preq replace. Not sure if I did anything wrong.
So how could we get rid of this stupid special chars and replace them with html entities?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘post_title: replace special chars like ??ü in wordpress title’ is closed to new replies.