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'm having some problems getting the WP Subtitle plugin to work.

After inserting the <?thesubtitle()?> or <?getthe_subtitle($id)?> into the index.php template I get a 'call to undefined function' error - inside or outside the loop doesn't seem to matter!

Thanks in advance

//Update

In most pages the following now works thanks to toscho's updated syntax

<?php get_header(); ?>

<div class="title-posts-container">
<h2 class="title-posts"><?php the_title(); ?></h2>
<p class="title-posts-strap"><?php the_subtitle(); ?></p>
</div>

<div class="content">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

But no such joy in index.php where the following fails

<?php get_header(); ?>

<div class="title-posts-container">
<h2 class="title-posts"><?php the_title(); ?></h2>
<p class="title-posts-strap"><?php the_subtitle(); ?></p>
</div>

<div class="content">

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
share|improve this question
    
Inserting what? –  toscho Mar 12 '11 at 22:43
    
Ooops forgot to hit the code button around the php tags –  toomanyairmiles Mar 12 '11 at 23:05

1 Answer 1

up vote 1 down vote accepted

Try the correct syntax:

<?php the_subtitle(); ?>
<?php get_the_subtitle( $id ); ?>
share|improve this answer
    
Ok, this code doesn't produce an error - it simply does nothing. –  toomanyairmiles Mar 13 '11 at 10:37
    
Well this is curious, it does work on normal pages and page templates but not in index.php?! –  toomanyairmiles Mar 13 '11 at 11:21
    
Add a longer snippet to your original question demonstrating how exactly you use it in index.php. Outside of the loop it shouldn’t work if your index.php is an archive. –  toscho Mar 13 '11 at 16:33
    
Thanks for your help, I've updated the question... –  toomanyairmiles Mar 15 '11 at 15:05
    
@toomanyairmiles If your front page is an archive and not a static page, then there is not page to choose a subtitle from. What do you expect to see? –  toscho Mar 15 '11 at 18:48

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.