Post will not load via ajax

All ajax requests should be routed through the handy /wp-admin/admin-ajax.php file. It works with the great WP hooks system. So you send an “action” with your request and use that as part of the action into which you hook your function. So, let’s say your ajax call looks like this (with jQuery) jQuery(‘a.ajax’).click(function(e){ data = … Read more

How to redirect RSS feeds to Feedburner and keep pretty permalinks?

The rules for Feedburner should come before the WordPress rules. And activate the rewrite engine just once. That’s enough. 🙂 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC] RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC] RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/ZoomingJapan [R=302,NC,L] RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>

Echo Permalink in Attachment outside of loop?

Jez, unpatient Jez 🙂 <?php $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘post_status’ => null, ‘post_parent’ => $post->ID ); $attachments = get_posts( $args ); if ( $attachments ) { foreach ( $attachments as $attachment ) { echo ‘<li> <a href=”‘. get_permalink($attachment->ID) .'” title=”Permanent Link to<?php the_title_attribute(); ?>”>’; echo wp_get_attachment_image( $attachment->ID, ‘full’ ); echo … Read more

Problem with parent page slug only in WordPress admin

Edit. Here’s another solution to not mess with the edit slug button. The function get_sample_permalink_html in wp_admin/includes/post.php outputs the sample permalink and an edit button. It can be filtered like this: add_filter(‘get_sample_permalink_html’,’my_sample_permalink’,10,2); function my_sample_permalink ($page_link,$id){ $page = get_page($id); if($page->post_type == “page” && $page->post_parent) { $parent = get_page($page->post_parent); $page_link = preg_replace(“/(sample-permalink\”>).*?(<)/”,”$1″.home_url(“https://wordpress.stackexchange.com/”).$parent->post_name.”/$2″,$page_link); } return $page_link; } Can’t … Read more

Test site pages go to main site

Your htaccess file seems to be a little off. I would suggest the first part of the file should look like the following… <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /testsite/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /testsite/index.php [L] </IfModule> And that you store it in the ‘testsite’ folder not the root.