Show post by slug sanitize_title

Except the title of the post is echo sanitize_title(news_get_meta(‘gamers’)); I’m assuming news_get_meta is a function particular to a theme or plugin you have installed, so your query should be: $query = new WP_Query( array( ‘post_type’ => ‘spa’, ‘name’ => sanitize_title( news_get_meta(‘gamers’) ); ) );

Make user’s first and last name as user slug

To update existing users, try to make a script file and put that code on it (you have to require necessary file wp-load.php if you put that file in the root of your wp instance) or by listning on a hook like init hook : $blogusers = get_users( ‘role=subscriber’ ); //get users by role // … Read more

How to ignore GET parameter that’s the same as a CPT slug?

You should always preface your CPT names with something to avoid stuff like this – common naming leads to conflicts. My recommendation, so that you avoid this happening again would be to go and re-work your CPT code in your plugin/theme and use myplug_newsletter as the name of your CPT. Obviously change the myplug_ to … Read more

Category Slugs = 404s?

Here’s what I think is causing the problem: <?php query_posts($query_string . ‘&cat=-98, 101, 102’); ?> should be: <?php query_posts($query_string . ‘&cat=-98,-101,-102′); ?> The way it is now, it’s telling WordPress re-run the old query, but give me nothing from category 98, AND only pull posts from categories 101 and 102. I’m guessing you want it … Read more

add slug of child(ren) to li using wp_list_pages

OK, I almost got it now… I extended the Walker_Page Class: class Walker_Child_Classes extends Walker_page { function start_el(&$output, $page, $depth, $args, $current_page) { if ( $depth ) $indent = str_repeat(“\t”, $depth); else $indent=””; extract($args, EXTR_SKIP); $output .= $indent . ‘<li class=”‘ . apply_filters( ‘the_title’, $page->post_name, $page->ID ) . ‘”><a href=”‘ . get_page_link($page->ID) . ‘” title=”‘ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)