How to get next_posts_link working with a customised page
By changing the loop to use $wp_query instead of $query it worked. My challenge for another day is to delve into the differences between $wp_query and $query!
By changing the loop to use $wp_query instead of $query it worked. My challenge for another day is to delve into the differences between $wp_query and $query!
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
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
Set post beginning date and final date
Custom fields in normal posts
You may need to html entity decode that title. Similar to the issue found here. Try this: get_page_by_title( html_entity_decode(‘The #1 Reason to Buy Right Now – THE MONEY!!’), OBJECT, ‘post’, ));
Since the link doesn’t exist anymore, you can’t get rid of it. As Sisir wrote, probably there are backlinks to that URL and you can’t do anything about that (you don’t need to, as well). If your site got hacked you should always consider doing a complete recovery from backup (or, if this isn’t an … Read more
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
Post preview in iframe without saving the post
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