Filterable Portfolio Shortcode?

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
  • #546

    I’d like display the show_post_snippets post_type=”portfolio” in a non-portfolio template because I want to display other content above and below it on the page.

    There’s an existing shortcode to display portfolio:

    [show_post_snippets post_type=”portfolio” number_of_columns=4 post_count=4 image_size=”small” show_meta=false layout_class=”post-snippets full-width-snippets” display_text=false]

    However, I don’t see how I can make it filter. Is there a way I can specify that in the snippet? If not, what is a way that I can do that whereby I can still add content above AND below a portfolio?


    Great question. Just add two parameters to the above shortcode. The first one would be taxonamy= 'portfolio_category' and the second one that is like terms='printing,graphics' of comma separated values for actual category names you specified for portfolio items. Hope that helps.


    I like the way that worked BUT I’d really like it to work like it work as a sortable portfolio i.e. Anyway to display the portfolio this way through the snippet?


    Not currently. That would require some code change. Will ‘Portfolio Home’ page work for you? You can have content on the top with the help of Custom Heading Content markup in the metabox provided below the page editor. You can insert any number of segments into this field. Then the portfolio items would show up and rest of the content (additional segments) can be input in the regular TinyMCE page editor of WordPress. Not very flexible but gets the job done.

    Let me know if you this seems cumbersome and I can probably get a custom shortcode written to take care of this. I suspect it would require just a little bit of custom styling.


    Hi there

    I am trying to do the same. I see that mo_display_home_portfolio_content(), with the proper arguments will get it done but I need it as a shortcode. What do you think would be the quickest way to do this? Create a new shortcode in my functions.php file?

    thanks, and great theme!


    Hi – sorry for the delay. If you have not done this yet already, pls create the shortcode in custom/custom-functions.php file. The following should work –

    function mo_portfolio_shortcode() {
        $args = array(
            'number_of_columns' => 3,
            'image_size' => 'large-thumb',
            'posts_per_page' => 9,
            'filterable' => true
        $output = '
    '; // Note: Will need to modify the called method to return HTML instead of echo-ing $output .= mo_display_home_portfolio_content($args); $output .= '
    '; return $output; } add_shortcode('portfolio', 'mo_portfolio_shortcode');

    This seems tantalizing close to the solution to the problem I’ve had 3 developers chasing for weeks.

    Though not a coder …

    I have added the above code (unmodified) to my functions.php file. However, when I use the shortcode supplied by John with the two parameters you suggested, the portfolio displays, but the terms do not appear above the items (as they do on the sortable portfolio pages), so consequently I am not able to actually sort them.

    What am I doing wrong?


    I just released an update which has a shortcode named [show_portfolio] which hope meets your need. Pls have a look at the below page –

    The shortcode is –

    [show_portfolio number_of_columns=3 post_count=12 image_size='medium']

    I should mention though, that you cannot limit the categories here by providing taxonomy terms. I was not sure that is your requirement.


    I’ve just updated the theme. And indeed, the shortcode works.

    Now …

    There wouldn’t happen to be a parameter to display the portfolio item title, would there?


    No option to display the title. On hover, the user is able to view the title, category. For displaying title, you can try adding the below method to custom/custom-functions.php –

    function mo_get_portfolio_entry_text($thumbnail_exists, $excerpt_count) {
        $output = '
    '; $output .= "\n" . the_title('
    ', '
    ', false); $display_text = mo_get_theme_option('mo_hide_text_in_portfolio') ? false : true; if ($display_text) { $output .= '
    '; $output .= mo_truncate_string(get_the_excerpt(), $excerpt_count); $output .= '
    '; } $output .= '
    '; return $output; }

    and then calling the same in the method mo_get_home_portfolio_content() around line number 282 –

    $output .= mo_get_portfolio_entry_text(true, 100);

    You will need to style the text a bit. Hope this helps.


    I’ve succeeded in creating a filterable shortcode driven sortable portfolio homepage. Thank you for the update … it was the key to my eventual success.

    One last question. Where do I find and how can I change the label “Portfolio Filter” that precedes the sort buttons? I’d like mine to read “Initiative Filter.”

    As always, you help is most appreciated.


    Glad to hear that it helped. You can find the ‘Portfolio Filter’ string in the file framework/functions/blog-content.php file in the method mo_get_portfolio_categories_filter() around line number 588. Thanks

Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘Enigmatic Theme Support’ is closed to new topics and replies.