4336 posts ThemeForest Reviewer
  • Has referred 1+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Member of the Envato Team
+12 more
Ivor Envato team says

Hi guys, I’m sure you’re gonna help me :)

I have this title

<h1>&lt;?php the_title(); ?&gt;</h1>

But I want to display a subtitle with custom fields

<?php if ( function_exists( 'get_custom_field_value' ) ) { $bSubtitle = get_custom_field_value( 'subtitle' ); if ( trim( $bSubtitle ) == "true" ) { echo '<h?>'.$bSubtitle['subtitle'].''; } } ?>

Something is wrong here.

Thanks in advance!

4336 posts ThemeForest Reviewer
  • Has referred 1+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Member of the Envato Team
+12 more
Ivor Envato team says

Nevermind, this is a solve problem.

<?php $subtitle = get_post_meta($post?>ID, 'subtitle', true);

    if($subtitle) : ?>

    <h2><?php echo $subtitle; ?></h2>

<?php endif; ?>
60 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 50+ members
  • Located in Bolivia
  • Has collected 10+ items on Envato Market
+1 more
Slimmity says

to request a custom field use: get_post_meta($post->ID, 'subtitle', true); and you should use

$subtitle = (get_post_meta($post->ID, 'thumb', true)) ? true : false ; if ($subtitle) { '<h2>'.$subtitle.'</h2>';}

that should work. if now just let me know and ill try and help you out.

EDIT : guess you figure it out while i was replying xD

4336 posts ThemeForest Reviewer
  • Has referred 1+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Member of the Envato Team
+12 more
Ivor Envato team says

WordPress rocks doesn’t it? 8) I’m still learning it but I’m impress of how easy is to learn it, is a great jorney :P

707 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+2 more
ChillThemes says
WordPress rocks doesn’t it? 8) I’m still learning it but I’m impress of how easy is to learn it, is a great jorney :P

Indeed it does, it took me around a month to learn. :)

60 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 50+ members
  • Located in Bolivia
  • Has collected 10+ items on Envato Market
+1 more
Slimmity says

wp is realy easy :D

It took me a month or so also to learn it but im still learning… a lot of things can be done thanks to wp :)

by
by
by
by
by
by