4483 posts ThemeForest Senior Reviewer
  • Affiliate Level 1
  • Author Level 6
  • Collector Level 3
  • Envato Team
+14 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!

4483 posts ThemeForest Senior Reviewer
  • Affiliate Level 1
  • Author Level 6
  • Collector Level 3
  • Envato Team
+14 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
  • 6 Years of Membership
  • Affiliate Level 3
  • Bolivia, Plurinational State of
  • Collector Level 2
+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

4483 posts ThemeForest Senior Reviewer
  • Affiliate Level 1
  • Author Level 6
  • Collector Level 3
  • Envato Team
+14 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

709 posts
  • Affiliate Level 2
  • Author Level 5
  • Beta Tester
  • Collector Level 2
+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
  • 6 Years of Membership
  • Affiliate Level 3
  • Bolivia, Plurinational State of
  • Collector Level 2
+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