Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've created a new page type:

<?php
/*
Template Name: Pagina de Agenda
*/
?>


<?php get_header();?>

<?php $info_address = get_option('theme_info_address') ;?>



        <div id="content">


          </div>

        </div>
        <!-- END OF CONTENT -->
        <?php get_footer();?>

And the only thing I need, is to call [wcs] shortcode into content div... But It ain't working...

Already tried:

[wcs]

<?php echo do_shortcode('[wcs]'); ?>

do_shortcode('wcs')

None of them worked :s

I've seen a question about this here but didn't solve my problem yet...

share|improve this question
    
<?php echo do_shortcode('[wcs]'); ?> is correct. (I tested it.) I can only assume that there is something wrong with your shortcode callback function or with the registration of the shortcode but you didn't post that code. –  s_ha_dum Feb 13 '13 at 15:36
    
@s_ha_dum, thanks for your answer, take a look at my comments bellow \/ –  Lucas B Feb 13 '13 at 15:48
    
That is not a "comment" it is an "answer". Please edit your question to incorporate the additional information, and delete that answer-which-isn't-an-answer. –  s_ha_dum Feb 13 '13 at 15:55

1 Answer 1

I think you need something

is_page() 

to output the page content:

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?> 

further reading about shortcodes http://wp.smashingmagazine.com/2012/05/01/wordpress-shortcodes-complete-guide/

share|improve this answer
    
If I edit the page and add only [wcs], it works. But I need it to be added by default, simply by setting this specific page template (because who's gonna use this site has no tech knowledge)... I don't have to add a closure tag when I edit :s –  Lucas B Feb 13 '13 at 15:46
    
It works like this: oi47.tinypic.com/zivdrs.jpg I just need to add this [wcs] code by default on this page template :3 –  Lucas B Feb 13 '13 at 15:47
    
image is not working. show us the function code at funtions.php... that page-template what is intended to show? just one page, posts for the agenda? Show your content code... i think that was @s_ha_dum was asking for as well. –  jose pacheco Feb 13 '13 at 15:58
    
This is a schedule plugin: pulsarwebdesign.com/weekly-class-schedule - It isn't on functions.php - The page-template is as posted on the question /\ - I've fixed the image link now –  Lucas B Feb 13 '13 at 16:03
1  
The 3 first sentences are better placed as a comment in the Question. Finally, you mention is_page(), but it doesn't appear in the sample code... (¡?) :::: Check this meta. –  brasofilo Feb 13 '13 at 16:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.