Make a page (url) not cacheable [closed]

This has nothing to do with caching, but with form auto-completion. It is happening because the browser is set to store form content. To avoid this, you should generate a random code and add it to the name attribute of your input tags. Then send the random generated number trough another hidden input so you … Read more

Function to load correct CSS for Template not working

I think your big problem here is your use of underscores (_) in your page template names. According to the Handbook of Coding Standards Files should be named descriptively using lowercase letters. Hyphens should separate words. my-plugin-name.php Also, for best practices you should call your custom page templates page-whatever.php So for instance, index_page.php should be … Read more

Page templates in subdirectories and auto generator

Instead of having a page template for all of them, have a single page template and use get_template_part to pull in the parts unique to each page. So instead of: update_post_meta($new_page_id, ‘_wp_page_template’, $page_filename); You’d have: update_post_meta( $new_page_id, ‘_wp_page_template’, ‘newpagetemplate.php’ ); update_post_meta( $new_page_id, ‘sagive_page_type’, $page ); Then inside your new page template: $type = get_post_meta( get_the_id(), … Read more

Customizing Latest Post Pagination

Well I dug into the function I wrote a bit more and realize the flexibility of the customization I had. So I was able to achieve the above by writing the php this way: if (!function_exists(‘pagination’)){ function pagination($pages=””, $range = 2){ $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == ”){ … Read more

I want to rel=nofollow wordpress images

You need to hook into the image_send_to_editor filter. This allows you to modify the markup used when inserting an image into the content editor. Something like this should work: add_filter(‘image_send_to_editor’, ‘my_add_rel_nofollow’, 10, 8); function my_add_rel_nofollow($html, $id, $caption, $title, $align, $url, $size, $alt=”” ){ // check if there is already a rel value if ( preg_match(‘/<a.*? … Read more