Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #11164

    HI Guys.

    I would like to have a subtitle on each of my portfolio items, like on all the pages. It only need show up when you visit the single portfolio page. Could you tell me how I’d go about doing this.

    Many thanks,

    Sam

    #70802

    Hi Sam,

    You could use a custom field and then add an if statement to see if the portfolio is single to then display it.

    See: http://codex.wordpress.org/Function_Reference/is_single and http://codex.wordpress.org/Custom_Fields

    Regards,

    Devin

    #70803

    Hi Devin,

    I’m nearly there. I’ve created a custom Meta Box and called it into my single-portfolio.php file. all working great, except, I can’t pull it up into the title area. Here’s my example:

    http://www.ckproductions.co.uk/main/portfolio-item/andrew-bird/

    How do i pop it up under the title like on all the other pages?

    Cheers,

    Sam

    #70804

    Hi Sam,

    Move the sub-title function into loop-portfolio-single.php in your includes folder underneath this line.

    echo "<h1 class='post-title portfolio-single-post-title'>".get_the_title()."</h1>";

    Note: This line is a part of a PHP statement so you’ll need to follow the format above or close the PHP statement and open a new one.

    Regards,

    Mya

    #70805

    Hi Mya,

    That line isn’t in my loop-portfolio-single php. There is something similar in my single-portfolio.php file:

    Code:

    <?php
    if(empty($avia_config['slide_output']))
    {
    avia_title();
    }
    else
    {
    echo “<h2>”.get_the_title(avia_get_the_id()).”</h2>”;

    }

    echo “<h3>”.get_post_meta($post->ID, ‘ecpt_subtitle’, true). “</h3>”;

    ?>

    Try as i might, I simply cannot get that second h3 subtitle above the line. it looks like there is some styling on the h2 title that includes the horizontal line. I simply cannot find that anywhere. This is the last thing I need to do before getting this site done and live – please could you offer any other suggestions.

    Thanks,

    Sam

    #70806

    Hi Mya,

    I’ve manged to come up with a sort of solution by applying a negative not top-margin to the subtitle.

    That’s worked in terms of positioning it underneath the title. However, as a it’s not technically placed inside the title div and so it takes up no space. Therefore the grey bottom border does not expand with it. Could you tell me how to add additional padding to the title to get it to push the bottom border lower down, without affecting other pages?

    Many thanks,

    Sam

    #70807

    Hi Sam,

    Just to make sure what theme are you using?

    Regards,

    Mya

    #70808

    I’m using angular. Thanks,Mya.

    #70809

    Hi Starchie,

    It looks like you’ve got the sub-title working on the site :)

    Let us know if you have any other questions.

    Regards,

    Devin

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Subtitle on portfolio items’ is closed to new replies.