If you have troubles since the update to WordPress 4.5 please read this post before opening a new thread.
October 5, 2010 at 3:29 pm #1467
Hey I love the theme, great job! We have many portfolio items and add more at least once a week. Google and other search engines are not indexing these pages because they don’t have a proper title and description. I am using the “HeadSpace” plug-in that helps generate tags and it’s been great so far. However, I would love to be able to add a simple title and description to each portfolio item.
Could we accomplish this with Custom Fields? Custom fields aren’t available for the Portfolio Items either…
Thanks in advance for your help!October 7, 2010 at 8:59 am #35328
To add custom fields to portfolio items open up /theme_options/portfolio.php and find this code:
'supports' => array('title','thumbnail','excerpt','editor','comments')
Change it to this:
'supports' => array('title','thumbnail','excerpt','editor','comments', 'custom-fields')
This adds custom fields support to the Portfolio post type so you can add your title, etc.
to add custom fields to html text just use following php code:
<?php get_post_meta($post->ID, 'my_field', true); ?>
Please change my_field to the name of your custom field.October 7, 2010 at 2:08 pm #35329October 7, 2010 at 3:31 pm #35330October 10, 2010 at 11:26 pm #35331
Where should I add the “get_post_meta” php code to add custom fields to the html text.October 11, 2010 at 5:45 am #35332
You need to add your permalink code to this code in kriesi_post_thumb.php:
$defaultimage = $linkwrap."<img ".$img_attr_string." src='".$image_URL."' alt='' title='".get_the_title()."' height='".$option['wh']['height'] ." ' width='".$option['wh']['width'] ."' />".$linkwrap;
so it looks like
$defaultimage = $linkwrap."<img ".$img_attr_string." src='".$image_URL."' alt='".get_post_meta($post->ID, 'alt_field', true)."' title='".get_the_title()."' height='".$option['wh']['height'] ." ' width='".$option['wh']['width'] ."' />".$linkwrap;October 11, 2010 at 2:45 pm #35333
Sorry to be a pain, but it keeps giving me a syntax error. I know that I’m missing a small detail here…
I placed the new code in the kriesi_post_thumb.php and changed ‘alt_field’ to my custom field. Am I doing something wrong or not adding the right code somewhere?October 12, 2010 at 7:16 am #35334
The topic ‘Portfolio Title Description and Meta Data’ is closed to new replies.