How can I add more code to this?

To insert new code you need to break php code and past your new html+/-php code. But pay attention that after passing all will have correct syntax. Your question should be made like this: <?php $my_query = new WP_Query( “cat=11&posts_per_page=1” ); if ( $my_query->have_posts() ) { while ( $my_query->have_posts() ) { $my_query->the_post(); ?> <h2><a href=”https://wordpress.stackexchange.com/questions/53008/<?php … Read more

wp_rewrite not working on third level url

Your regex is a little flaky – you shouldn’t specify the start anchor ^, and some support trailing slashes, others don’t – plus I’d opt for a better expression for matching page numbers. And you could certainly trim it down to: add_rewrite_rule( ‘activate/([^/]*)/?$’, ‘index.php?pagename=activate&akey=$matches[1]’,’top’ ); add_rewrite_rule( ‘users/?$’, ‘index.php?pagename=users’,’top’ ); add_rewrite_rule( ‘users/(most-active|recent|oldest|by-username)/?$’, ‘index.php?pagename=users&sort=$matches[1]’,’top’ ); add_rewrite_rule( ‘users/(most-active|recent|oldest|by-username)/paged/([0-9]{1,})/?$’, … Read more

Redirect back to origin page after using get_delete_post_link()

Theres a filter you can hook on to. apply_filters( ‘get_delete_post_link’, wp_nonce_url( $delete_link, “$action-{$post->post_type}_{$post->ID}” ), $post->ID, $force_delete ); Check the raw function here: http://core.trac.wordpress.org/browser/tags/3.4.1/wp-includes/link-template.php#L954 Can’t advise much else without seeing your code. Edit: its nasty buy you can do add_filter( ‘get_delete_post_link’, ‘some_function’, 20 ); function some_function() { wp_redirect( home_url(“https://wordpress.stackexchange.com/”) ); exit; }