Support » Fixing WordPress » Remove Front Slash frm the_search_query

  • My theme (a custom hack job) uses the_search_query to display search terms in the title and on the page. When one does a searh with quotes for example “Star Trek” any place search_query is used it displays \”Star Trek\”

    This link is a good example.

    How do I remove these slashes that are added?

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you can find where the search term is being printed you could wrap it with stripslashes(‘your string here’)

    I have read about that. My knowledge of php is to lacking to figure out how to use it. The offending bits are:

    <a href="/search/<?php the_search_query(); ?>"><?php the_search_query(); ?></a>

    And in the search box itself I use this to show what was searched:
    <?php the_search_query(); ?>

    Don’t suppose anyone could show me how to use stripslashes on these?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove Front Slash frm the_search_query’ is closed to new replies.