• Resolved gostcoder

    (@gostcoder)


    Recently I Created a CPT as well as CPT Template Called Job.php

    and when I try to add some shortcode inside this Custom Template It’s Not showing the shortcode data it returns the shortcode itself

    I am sharting the images and COde for this Problem Please check this Issue

    Custom Template Code

    <?php
    
    /* *Template Name:Default Jobs
        *Template Post Type:post,jobs,page
    */
    
    get_header();
    
    if (
    	blocksy_default_akg(
    		'page_structure_type',
    		blocksy_get_post_options(),
    		'default'
    	) !== 'default'
    	&&
    	is_customize_preview()
    ) {
    	blocksy_add_customizer_preview_cache(
    		function () {
    			return blocksy_html_tag(
    				'div',
    				[
    					'data-structure-custom' => blocksy_default_akg(
    						'page_structure_type',
    						blocksy_get_post_options(),
    						'default'
    					)
    				],
    				''
    			);
    		}
    	);
    }
    
    if (have_posts()) {
    	the_post();
    }
    
    /**
     * Note to code reviewers: This line doesn't need to be escaped.
     * Function blocksy_output_hero_section() used here escapes the value properly.
     */
    if (apply_filters('blocksy:single:has-default-hero', true)) {
    	echo blocksy_output_hero_section([
    		'type' => 'type-2'
    	]);
    }
    
    $container_class = 'ct-container';
    
    if (blocksy_get_page_structure() === 'narrow') {
    	$container_class = 'ct-container-narrow';
    }
    
    $content_style = blocksy_get_content_style();
    
    ob_start();
    the_content(
    	sprintf(
    		wp_kses(
    			/* translators: %s: Name of current post. Only visible to screen readers */
    			__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'blocksy' ),
    			array(
    				'span' => array(
    					'class' => array(),
    				),
    			)
    		),
    		get_the_title()
    	)
    );
    $post_content = ob_get_clean();
    
    ?>
    
    	<div
    		class="<?php echo trim($container_class) ?>"
    		<?php echo wp_kses_post(blocksy_sidebar_position_attr()); ?>
    		<?php echo blocksy_get_v_spacing() ?>
    		<?php echo blocksy_get_entry_content_editor() ?>>
    
    		<?php do_action('blocksy:single:container:top'); ?>
    
    			   
    		<section>
    		    			    	<div class="card">
    <div class="card-body">
    <h4 > <span> [custom-tax id="post"]</span></h4>
    <h5 class="card-sub-title">Company: [custom-tax id="company"]</h5>
    <div class="row">
    <div class="col-lg-6">
    <p class="card-meta"><i class="fa fa-map-marker" aria-hidden="true"></i> [custom-tax id="city"], [custom-tax id="state"]</p>
    <p class="card-meta"><i class="fa fa-graduation-cap" aria-hidden="true"></i> [custom-tax id="qualification"] </p>
    </div><div class="col-lg-6">
    <p class="card-meta"><i class="fa fa-briefcase" aria-hidden="true"></i> [custom-tax id="job-type"]</p>
    <p class="card-meta"><i class="fa fa-inr" aria-hidden="true"></i> <?php the_field('job_basesalary_currency'); ?> <?php the_field('job_basesalary_value'); ?> /  <?php the_field('job_basesalary_unit'); ?></p>
    </div>
    </div>
    </div>
    <div class="card-footer bg-white">
    <i class="fa fa-calendar fa-lg text-danger" aria-hidden="true"></i> <span class="text-muted card-meta">Last Date: </span><span class="card-meta"><?php the_field('job_valid_through'); ?></span> <i class="text-muted float-right"><small>Posted On: <?php echo human_time_diff( get_the_time('U'), current_time('timestamp') ) . ' ago'; ?></small></i>
    </div>
    </div>
    			<?php
    				/**
    					* Note to code reviewers: This line doesn't need to be escaped.
    					* Function blocksy_single_content() used here escapes the value properly.
    					*/
    				echo blocksy_single_content($post_content);
    			?>
    				<div class="job_cpt_css">
    		<a href="<?php the_field('apply_today_now_link'); ?>" class="job_cpt_css_link "  >Apply Today Now</a>
    		</div>
    		</section>
    	
    
    		<?php get_sidebar(); ?>
    
    		<?php do_action('blocksy:single:container:bottom'); ?>
    	</div>
    
    <?php
    
    blocksy_display_page_elements('separated');
    
    have_posts();
    wp_reset_query();
    
    get_footer();

    `

    Useing Plaugin for Shortcode is ===========

    “Custom post types” by Version 2.1.19 | By Andrea De Giovine

    Try to Display Taxonomy Url Using Shortcode provide by this Plugin

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Short code Not Display Properly in custom Template’ is closed to new replies.