How to add Related Posts/Projects to Portfolio Page

Community Forums Forums General Discussion How to add Related Posts/Projects to Portfolio Page

This topic is: resolved

This topic contains 6 replies, has 3 voices, and was last updated by  Murch55 1 year ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #52663

    Murch55
    Participant
    Post count: 2

    I’m updating my regular WordPress portfolio site to Modern Portfolio, but I would like to add Related Projects with thumbnails/links at the bottom of each Portfolio Page. Here is an example from my current site: http://charlenemcmurtrie.com/portfolio/tgen-mindcrowd-website/

    I know there are Related Posts plugins that work with Genesis (like YARPP), but I don’t know how to apply the plugin to the portfolio section. Any help is greatly appreciated.

    Thanks,
    Charlene

    #52722

    braddalton
    Participant
    Post count: 9724

    Hi Charlene

    Here’s the code you can paste into your child themes functions.php file. It add s widget which you can reposition by changing the hook position.

    https://gist.github.com/braddalton/6093547


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #58133

    jodzeee
    Participant
    Post count: 216

    Hopefully Charlene found this as useful and easy as I did. As always, thanks so much, Brad!

    #58264

    braddalton
    Participant
    Post count: 9724

    No worries.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #58267

    Murch55
    Participant
    Post count: 2

    So sorry for my lack of response to your answer Brad. Truth is, I’m a newb when it comes to Genesis and I am still learning about Hooks and such. I tried following your instructions, and it didn’t work so I’ve been trying to figure it out while learning. I did have two more questions –
    1. Since the code you’ve provided is a widget, do I need to register it?
    2. Since I only want related portfolio projects to appear on portfolio pages (my theme has both a portfolio and a blog) – Should I place the snippet in the Theme functions.php (as you first directed), custom functions.php or in the page_portfolio.php? Not sure what I’m doing wrong.

    Thanks for your help and again, I apologize for not responding or closing this thread out.
    Charlene

    #58273

    braddalton
    Participant
    Post count: 9724

    1. The code already includes everything to register the widget which you will see in your Widgets page.

    2. Please copy the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++.

    This line determines where the widget outputs the content and can be modified:
    [php]
    if( in_category(‘portfolio’) && is_single() ) {
    [/php]

    It only works if you have a category named portfolio and then displays the widget content after single posts assigned to that category.

    You can change the conditional tag to something like this:
    [php]
    if ( ‘portfolio’ == get_post_type() ) && is_single() ) {
    [/php]


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #58278

    Murch55
    Participant
    Post count: 2

    Thanks for the quick response Brad. I’ll give it a go. You’ve been a big help. Thanks.

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

You must be logged in to reply to this topic.