Use page template instead of custom post type archive

You can create a page template named template-page-projects-archive.php (for example) that contains the following code: <?php /** * Template Name: Project Archives */ require( locate_template( ‘archive-wm_projects.php’ ) ); exit(); When editing a page where you’d like to use the archive-wm_projects.php template, just select Project Archives from the template dropdown.

Generating excerpts from a custom post type to display in a Widget

SOLVED Use this code in the function.php file function custom_field_excerpt() { global $post; $text = get_field(‘description’); //Replace ‘your_field_name’ if ( ” != $text ) { $text = strip_shortcodes( $text ); $text = apply_filters(‘the_content’, $text); $text = str_replace(‘]]&gt;’, ‘]]&gt;’, $text); $excerpt_length = 20; // 20 words $excerpt_more = apply_filters(‘excerpt_more’, ‘ ‘ . ‘[…]’); $text = wp_trim_words( … Read more

Want to display my custom date archive to date.php but dont know how

You will need to write a custom rewrite rule for this. Just copy the following code into your functions.php and flush rewrite rules. function xlinkerz_custom_archive_rewrite_rule( $rewrite_rules ) { $custom_slug = ‘custom_archive’; $year_rule = array( $custom_slug . ‘/([0-9]{4})/([0-9]{1,2})/?$’ => ‘index.php?year=$matches[1]&monthnum=$matches[2]’ ); $month_rule = array( $custom_slug . ‘/([0-9]{4})/?$’ => ‘index.php?year=$matches[1]’ ); // Merging rules $rewrite_rules = $year_archive … Read more