adding read more link for custom post type

You can do this using, <div class=”container” style=”margin-top: 20px;”> <h1>Our Products</h1> <?php $args=array(‘post_type’ => ‘products’); $query= new WP_Query($args); while ($query-> have_posts() ) : $query->the_post()?> <div class=”col-lg-2 col-md-2 col-sm-4 col-xs-12″> <!– Add permalink as below –> <a href=”https://wordpress.stackexchange.com/questions/206132/<?php the_permalink(); ?>”><h1><?php echo the_title();?></h1></a> <?php the_post_thumbnail( ‘full’, array( ‘class’ => ‘innerimages’) );?> </div> <?php endwhile; ?> </div> And … Read more

Template code to split a post and print a custom field?

I’d suggest doing it this way to avoid running into problems where you split within a sentence/paragraph. Try splitting on <p> – then put the first element (first paragraph) into <div class=”content-first-half”> and the rest (if any) into <div class=”content-second-half”> in your template. It should be something like this (assuming $content has the html for … Read more

Variable Products as custom post types

Use it can be done using CUSTOM META BOX. Add following to function.php: /* Adds pizza size meta box to the post editing screen ******************************************************/ function prfx_custom_meta() { add_meta_box( ‘prfx_meta’, __( ‘Pizza Size’, ‘prfx-textdomain’ ), ‘prfx_meta_callback’, ‘post’ ); } add_action( ‘add_meta_boxes’, ‘prfx_custom_meta’ ); /* Outputs the content of the meta box **************************************/ function prfx_meta_callback( $post … Read more

Custom Post Type Archive template not being called

Everything you describe is expected behavior based on your post type registration settings. A page isn’t going to load an archive template, I’m not sure why you’d expect it to. Your rewrite argument slug is only for single posts. Setting has_archive to true uses the post type slug as archive location, which is ttwi_course. If … Read more