White screen of death on post save only

Per the comment on the original question and work with hosting technical support, the problem was indeed the child theme. Both the comment and tech support gave me a possibility to pursue, but not a conclusive answer. So, here is how I pursued it. The parent theme was Twenty Sixteen. The child theme only had … Read more

Include related posts on a page

You could easily modify the page template of your theme to include a section that reads “Related Posts” at the bottom and then execute a simple PHP query to get posts as follows: <?php query_posts(‘category_name=wordpress&showposts=5’); ?> <?php while (have_posts()) : the_post(); ?> <li> <a href=”https://wordpress.stackexchange.com/questions/10085/<?php the_permalink(); ?>”> <?php the_title(); ?> </a> </li> <?php endwhile; ?> … Read more

same archive template for different custom post

There are template filters for all types of queries. You could use archive_template in this case. function wpd210689_template_filter( $archive_template ) { $post_types = array( ‘america’, ‘china’, ‘nepal’, ‘norway’, ‘chile’ ); if ( is_post_type_archive ( $post_types ) ) { $archive_template = locate_template( ‘archive-country.php’ ); } return $archive_template; } add_filter( ‘archive_template’, ‘wpd210689_template_filter’ ) ;

Add a custom option to a page in backend

To add a option box for a page or post, you need to use add_meta_boxes action. //Register Meta Box function register_meta_box() { add_meta_box( ‘meta-box-id’, __( ‘MetaBox Title’, ‘text-domain’ ), ‘meta_box_callback’, ‘post’, ‘advanced’, ‘high’ ); } add_action( ‘add_meta_boxes’, ‘register_meta_box’); //Add field function meta_box_callback( $post_id ) { $output=”<label for=”title_field”>”. esc_html__(‘Title Field’, ‘text-domain’) .'</label>’; $title_field = get_post_meta( $post_id->ID, … Read more

Handling an Ajax form submit

You should remove the link from the anchor tag: <a class=”button” href=”#” style=”background-color:white;color:black;”> <strong>Submit</strong> </a> Then your jQuery part should be: $(‘a.button’).click(function(event){ event.preventDefault(); //your ajax gets here: jQuery.ajax({ type:”post”, dataType:”json”, url: ajaxurl, data: {action: ‘submit_data’, info: info}, success: function(response) { alert(“Success”); } }); });

How to customize read more link

There are a number of ways this can be achieved, some more complex than others, some offering more functionality than others, however it all depends on your usage-case. For now, the most simple method is to use a combination of, custom fields and a… conditional if/else statement Step 1) In your post edit screen you … Read more