Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

Corneliatt on "Strip down get_the_title() - compare with CPT"

$
0
0

Hi! I've got a query that looks like this:

$title = get_the_title();

$new_query = new WP_Query(array('faq' => $title, 'post_type' => 'question_faq', 'orderby' => 'rand', 'showposts' => '1'));

This works perfectly, until $title got "!?>åäö" etc. Is there a way to strip down all this "extras", or get a "slug version" of a the_title()? Or do you have any other ideas of how to compare my custom post type "faq" slugs with the_title?

Thank you in advance!


Viewing all articles
Browse latest Browse all 8245

Trending Articles