Modify WordPress loop after it has been run

First: Indent your code consistently, your code editor should do this automatically, if it doesn’t, you should change, I can recommend Sublime Text as a free option, but there are hundreds of others Don’t spam PHP tags, <?php echo ‘you’; ?><?php echo ‘ dont ‘; ?><?php echo ‘need ‘;?><?php echo ‘this’; ?>, when <?php echo … Read more

Post as frontpage – avoid duplicate content

Your best way would be to redirect to the theme’s 404 page in the event that the page being loaded matches the slug that you are referring to. Try this: function check_undesirable_page(){ global $post; if(is_page() && ($post->post_name==”YOUR-SLUG-HERE”)){ global $wp_query; $wp_query->set_404(); status_header(404); } } add_action( ‘wp’, ‘check_undesirable_page’ ); EDIT: Also a good idea to incorporate the … Read more

Export Posts with specific custom fields by sql

Hi The tables that you need to consider is wp_posts – Which contains all the details about the posts. wp_postmeta – Which is used to store the meta details for a post with relation to post_id. Query will be Select * FROM wp_posts a, wp_postmeta b WHERE a.post_status=”published” AND a.post_id = b.post_id AND b.meta_key = … Read more

Expired Post with More Recent Time Stamp?

I am pretty sure that what you are looking at are post revisions. The posts with status “expired” are the primary post. The ones with “inherit” are revisions or autosave. Look at the post_name column and you should see a pattern like **-autosave-** or **-autosave-**, and then look at the post_parent column and your “expired” … Read more