Support » Themes and Templates » How to get a quote-sign (‘) in a theme php-function

  • Hello, I am trying to translate the WordPress default theme into Dutch. For this, I need to translate the “Pages” header in the side bar to “Pagina’s”. Did you notice the quote sign before the “s” in this word? That is what I cannot get right.

    The code from the theme looks like:
    <?php wp_list_pages('title_li=<h2>Pagina\'s</h2>' ); ?>

    I am not accustomed to php, but in C I would escape the quote sign (\’) to get it displayed. In this case the final output is just what is typed in the code: “Pagina\’s”. And that is not what I want. If I remove the “\”, I get a syntax error on the side bar. I also tried html &-character codes, but this is also not properly processed.

    Any help will be appreciated.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Try using double quotes instead of single quotes, although I can’t remember if this works or not. Let me know if it does.

    <?php wp_list_pages("title_li=<h2>Pagina\'s</h2>"); ?>

    But without the \', just '

    Sorry, the suggestions above do not work.

    <?php wp_list_pages("title_li=<h2>Pagina\'s</h2>" ); ?> produces “Pagina\\\’s”.

    <?php wp_list_pages("title_li=<h2>Pagina's</h2>" ); ?> produces “Pagina\’s”.

    Without the “s, of course

    Just a little kick to get this item back “on top”. I still have no clue to how to solve this problem.

    \’ does not do the trick. A simple ‘ gives a syntax error. ampersand#39; or \ampersand#39; does not work (I mean the ampersand sign, but if I use that in this post, I wouldn’t show). Mixing single a double quotes has an effect, but not the effect I want.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to get a quote-sign (‘) in a theme php-function’ is closed to new replies.