Testimonial on Portfolio page

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #3524
    maxmays
    Member

    Is there a good way to get a certain testimonial loaded on an individual portfolio page, under the project details? I tried inserting the shortcode in the custom fields option and in the Additional Project Notes box, but it wouldn’t pull in that way.

    #3533
    Raghavendra
    Moderator

    The additional project notes box currently does not process shortcodes, if any, inserted into it (did not anticipate it due to lack of space there).

    Will the testimonial inserted into the main content itself work for you? See an example below –

    https://www.livemeshthemes.com/extinct/portfolio/justo-euismod-blandit/

    The above example does not utilize a shortcode but you can use the shortcode within the main content of the portfolio page. Hope that works for you.

    #3538
    maxmays
    Member

    That can work, sure. I was pulling in the testimonial through the shortcode to the new testimonial posts section, which of course pulls in the photo and puts a speech bubble around the quote, so I thought it would look better in the sidebar under the project info. It looks like in your example that the testimonial is entered again manually as a standard blockquote section rather than pulling from the testimonials section…

    #3544
    Raghavendra
    Moderator

    If you really need the shortcode function in the description sidebar field of portfolio entry, you can make a small change in the code in single-portfolio.php file in the theme folder. Pls change line number 43 to

    $project_info = do_shortcode(get_post_meta($post->ID, '_portfolio_info_field', true));
    

    and shortcodes will start working in that field.

    #3562
    maxmays
    Member

    Meteorite:

    I tried this change to see if it would work. I’m inserting the shortcode into the “Additional Project Notes (HTML accepted)” field in the Portfolio Information section on the Edit Portfolio Entry page.

    Here is the shortcode that I inputted, copying from a working shortcode entry: [testimonials class=”quote-wrap alignright” post_count=1 column_count=2 testimonial_ids=”4226″]

    I got the following error in the space below the basic Portfolio Information section:

    Warning: Invalid argument supplied for foreach() in /hermes/bosoraweb099/b2776/ipg.rkennethcapps/retheme/wp-content/themes/extinct/framework/functions/post-functions.php on line 100

    Warning: implode() [function.implode]: Invalid arguments passed in /hermes/bosoraweb099/b2776/ipg.rkennethcapps/retheme/wp-content/themes/extinct/framework/functions/post-functions.php on line 103

    Attached is a screenshot. Please advise.

    Thanks,

    Max

    #3564
    maxmays
    Member

    Okay, sorry, but the error message apparently is related to not having checkmarked a portfolio category in my test portfolio entry. However the testimonial is still not displaying.

    Thanks,

    Max

    #3568
    Raghavendra
    Moderator

    Can you post a private message here with the temp login to the site? Will take a look. Thanks

    #3570
    maxmays
    Member
    This reply has been marked as private.
    #3580
    Raghavendra
    Moderator

    I have made the required changes to make this work. First, had to make the change in single-portfolio.php at line number 45 –

                echo '
    ' . do_shortcode(htmlspecialchars_decode($project_info));

    and the earlier change was undone. We had to preprocess the contents before applying the shortcode here.

    Second, had to change the file framework/functions/utility-functions.php at line number 256 to add the below condition –

    
                case 1:
                    $style_class = '';
                    break;
    

    to help style the content when column_count=1 for this shortcode. These changes can be useful to others and hence will be part of next update and hence no need to worry about losing them if you upgrade.

    #3591
    maxmays
    Member

    This looks like exactly what we need… thanks so much for your help! I hope others find it useful as well.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Testimonial on Portfolio page’ is closed to new replies.