Tag Info

Hot answers tagged

1

You can also do by this <?php the_post(); if ( is_home() ) { ?> <meta name="description" content="YOUR DESCRIPTION" /> <?php } elseif (is_single()) { ?> <meta name="description" content="<?php the_excerpt(); ?>" /> <?php } ?> this will set different description for home and other.


1

I packed everything together. Consider using wp_enqueue_script() to use the script. With this code, you will save all URLs as an array. See how I use get_post_meta() to retrieve the saved URLs. function save_custom_metabox($post_id){ if(!isset($_POST['source_post_metabox_nonce'])) : return; endif; if(!wp_verify_nonce( ...


1

You hook the tr_change_show_title to a filter inside the function itself, that can make a infinite loop. All the stuff removing/adding actions and filters inside the functions should be deleted; instead check if the post data should be updated or not. In your case you should check if the title has the value you desire or not, if not run wp_update_post with ...


1

From what I can tell, this stems from your use of get_post_field(), which is reserved for fields found in the posts table of the database (ie: built-in to WordPress, rather than custom fields). For custom fields you should use get_post_meta().



Only top voted, non community-wiki answers of a minimum length are eligible