Stop post submission without losing data?

I had to do the exact same thing with a custom post type that would be useless and cause theme problems without metadata. You’ll have to either A. Check the post for metadata AFTER it has been published using the transition_post_status hook, and if the metadata isn’t there, change the status to “draft” and throw … Read more

wordpress post not showing my “” text>?

You have to escape th < and the > with &lt; and &gt;, otherwise WordPress will remove the “unknown tags”. You could also filter pre_kses to change the output before it gets stripped. add_filter( ‘pre_kses’, function( $str ) { // find and escape < and > on specific positions, then return $str; });

Email notification of new post includes code

You surely copied the content directly from the Microsoft Word. Because that MsoNormalTable thing I found in the texts when copied directly from MS Word. Copying directly from MS Word takes some formatting along with it. So, you can try any of the methods either : Copy the texts from MS Word, and paste them … Read more

Wrap posts p tags in div

You need to add it to a JS file and then enqueue it in your functions.php jQuery(document).ready(function($){ $(‘p’).wrap(‘<div class=”post-txt” />’); }); If you already have a js file, you can add it to that file and you’re done. Else, save the above snippet in a new file. Put that file in a folder called js … Read more

custom taxonomy listing returns no posts

Answer moved from an edit in the answer to a real answer. This is my query <?php $taxonomy = (get_post_type() == ‘post’ ? ‘category’ : (get_post_type() == ‘news’ || is_tax(‘news_categories’) ? ‘news_categories’ : ‘category’)); $tax_terms = get_terms($taxonomy, array(‘hide_empty’=> false) ); global $wp_query; if( isset($_GET[‘s’]) ): $wp_query->is_search = true; endif; // var_dump($activeCategoryName = $wp_query->queried_object); if(is_tax(‘news_categories’)) { … Read more

Date is wrong on ‘all posts’ page

It could be because you are not supplying post id in time parameter function. In place of the_time(‘d F’) try using echo get_the_time(‘d F’m $post->ID) because it will give you the flexibility to supply post id when you are in a loop. Reference: get_the_time Codex EDIT My bad, I guess $post variables are not being … Read more

Can i have more than one form for front end posting in one template [closed]

Yes. You can check which form is being submitted by adding a “name” attribute to the submit button. <input type=”submit” name=”form1″ value=”Submit”> Then in you validation, just check if that exists: if(isset($_REQUEST[‘form1’])){ // Form 1 } elseif(isset($_REQUEST[‘form2’])) { // Form 2 } This is one method at least, there are plenty of ways to deal … Read more