Okay
  Public Ticket #3213485
Portfolio mixed template - Page content before & after
Closed

Comments

  •  2
    David Ugarkovic started the conversation

    I'd like to create a home page, where I would like to insert the section with portfolio items in between the content of the page. If I choose Portfolio Mixed template for the page, the portfolio is either shown in the beginning or in the end. Is there a way that I could include those items in the middle?

  •  1,778
    Support replied

    Hi David

    This is custom work indeed. That means looping through half of the portfolio items, adding the content and then the rest of the items. Not sure really how the content sits inside itemsWrapperLinks and itemsWrapper outer divs of the portfolio grid.

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy

  •  2
    David Ugarkovic replied

    If anyone needs it, I solved by adding portfolio wrap from portfolio mixed to another .php file, set sanitize_html_class to custom values manually (unfortunately it's not dynamic, but easy to change in code if necessary) and created a new shortcode in shortcodes.php that calls template parts:

    function template_part( $atts, $content = null ){
        $tp_atts = shortcode_atts(array(
           'path' =>  null,
        ), $atts);
        ob_start();
        get_template_part($tp_atts['path']);
        $ret = ob_get_contents();
        ob_end_clean();
        return $ret;
     }
     add_shortcode('template_part', 'template_part');

    Then, finally called that template with the shortcode:

    [template_part path="your_custom_file_name"]
  •  1,778
    Support replied

    Hi David,

    Thanks for sharing the solution, I see that you meant portfolio grid as a block in the content not the other way around (the content intercalated inside the portfolio grid), i've misunderstood.

    Thank you.

    Clapat Support

    https://www.clapat.com/

    Review Envato Item Support Policy