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

Dynamic form variables for post meta

got this working! here is an example of how to set up the form. <script type=”text/javascript”> jQuery(document).ready(function($) { $(‘.metabox_submit’).click(function(e) { e.preventDefault(); $(‘#publish’).click(); }); $(‘#add-row’).on(‘click’, function() { var row = $(‘.empty-row.screen-reader-text’).clone(true); row.removeClass(’empty-row screen-reader-text’); row.insertBefore(‘#repeatable-fieldset-one tbody>tr:last’); return false; }); $(‘.remove-row’).on(‘click’, function() { $(this).parents(‘tr’).remove(); return false; }); $(‘#repeatable-fieldset-one tbody’).sortable({ opacity: 0.6, revert: true, cursor: ‘move’, handle: ‘.sort’ }); … 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