Using next/previous_posts_link with customised search

You don’t need the type variable and other bits of custom search query code, or custom functions like the other answers. In your searchbox, instead of submitting the form to / submit it to /my_post_type/ instead! WordPress will handle all the rest for you automagically, with no effort involved. What’s more this means all the … Read more

‘paged’ in wp_query doesn’t work

You set offset param, so paged param is ignored 😉 From Codex: offset (int) – number of post to displace or pass over. Warning: Setting the offset parameter overrides/ignores the paged If you want to ignore most recent post in this query, you can achieve it in two ways. 1. Custom pagination. $ppp = get_option(‘posts_per_page’); … Read more

Change page /2 to /transcript with a Rewrite

The rewrite API won’t redirect – it just “maps” URL structures to query strings – you’ll need to do this yourself. First things first, fix that rewrite rule: ‘episode/([^/]+)/transcript’; // Matches anything that follows transcript, not what we want! ‘episode/([^/]+)/transcript/?$’; // Matches only “episode/name/transcript”, optionally with a trailing slash Now bring in a helper function: … Read more

Custom Taxonomy not working with posts_per_page in new WP_query (pagination problem)

should it be.. $paged = (get_query_var(‘page’)) ? get_query_var(‘page’) : 1; WP_Query in codex: Pagination Note: You should set get_query_var( ‘page’ ); if you want your query to work with pagination. Since WordPress 3.0.2, you do get_query_var( ‘page’ ) instead of get_query_var( ‘paged’ ). The pagination parameter ‘paged’ for WP_Query() remains the same.

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