Additional .htaccess rules based on wp page

I’m pretty sure you have wrong “rewrite” parameter in your add_rewrite_rule call. I’m writing it directly in here, so it can be buggy… But it should look something like this: add_rewrite_rule(‘^authors/([^/]*)/([^/]*)/?’,’index.php?page_id=<YOUR AUTHOR PAGE ID>&my_author_name=$matches[1]&my_author_pic=$matches[2]’,’top’); Then you can use add_rewrite_tag (http://codex.wordpress.org/Rewrite_API/add_rewrite_tag) to add your custom query variables (my_author_name and my_author_pic). And in your author page you … Read more

Import existing image as a single post

See my answer here: The Media Library lives in both wp_posts and wp_postmeta. wp_postmeta contains the image URL wp_posts contains an entry for each image insertion into a post, along with the post ID. Exporting and importing these 2 tables as SQL did not work for me – I received ‘duplicate entry for key 7’… … Read more

Custom Form only for admin

Well, it won’t be easy, but you can do this in this way: Add a Custom Post Type (you can restrict access to this CPT for admin only). Use Advanced Custom Fields plugin and create custom fields template for your Custom Post Type from 1. Create a custom page template and place custom query inside … Read more

How to include Related Posts in WP RSS feed

You have to use the_content and the_excerpt_rss hooks. You can do this like this: function rss_append_footer($content) { if(is_feed()) { $related_posts_html = … // I assume you already can compute it $content .= $related_posts_html; } return $content; } add_filter(‘the_content’, ‘rss_append_footer’); add_filter(‘the_excerpt_rss’, ‘rss_append_footer’);

get_next_posts_link() stops displaying at page 4

I don’t know where $era_opts comes from but a filter on pre_get_posts should do this and preserve your pagination. function era_blog_cats_wpse_103587($qry) { if ($qry->is_page(‘your-page’) && is_main_query()) { $era_opts = get_option(‘era_opts’); // assuming that era_opts are options $blogcats = $era_opts[‘era_opts_blog_thecats’]; if(!empty($era_opts[‘era_opts_blog_thecats’])) { $qry->set(‘category__in’, $blogcats); } } } add_action(‘pre_get_posts’,’era_blog_cats_wpse_103587′); I made several assumptions about your data, but … Read more