• Resolved accend4web

    (@accend4web)


    I have created inside my child theme a template using the code from another template. I then created a Category called -‘Ridgeway Research News’ and have created 1 post for the time being and associated it with that category, all seems pretty fine.

    Then I have a page called ‘News’ which I associated with the new template thats going to be used just for this page.

    I have the code below, and when I paste the following shortcode in, the actual text for the shortcode line of php shows on the page rather than the actual post.

    <?php echo do_shortcode("[ic_add_posts category='Ridgeway Research News' showposts='3']"); ?>

    here is my page – Link to News page

    And here is how my code currently looks –

    <?php /* Template Name: Ridgeway-News-Page */ ?>
    <?php get_header(); ?>
    <?php get_template_part('element', 'page-header'); ?>
    <div id="main" class="main">
    	<div class="container">
    <section id="content" class="content">
    <?php do_action('cpotheme_before_content'); ?>
    			
    <?php if(have_posts()) while(have_posts()): the_post(); ?>
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <div class="page-content">
    <?php do_action('cpotheme_after_title'); ?>
    <?php the_content(); ?>
    <?php echo do_shortcode("[ic_add_posts category='Ridgeway Research News' showposts='3']"); ?>
    </div>
    </div>
    <?php endwhile; ?>
    <?php if(get_query_var('paged')) $current_page = get_query_var('paged'); else $current_page = 1;?>	
    <?php $query = new WP_Query('post_type=cpo_service&paged='.$current_page.'&posts_per_page=-1&order=ASC&orderby=menu_order'); ?>
    <?php if($query->posts): $feature_count = 0; ?>
    <section id="services" class="services">
    <?php cpotheme_grid($query->posts, '', '', 3); ?>
    </section>
    <?php cpotheme_numbered_pagination($query); ?>
    <?php wp_reset_postdata(); ?>
    <?php endif; ?>
    <?php do_action('cpotheme_after_content'); ?>
    </section>
    <!--<?php get_sidebar(); ?>-->
    <div class="clear"></div>
    </div>
    </div>
    <?php get_footer(); ?>

    So my problem seems to be that I’m not allowed to use a shortcode here and cant work out why or how to et around it.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Showing a shortcode in page not working’ is closed to new replies.