• Resolved spiritvegetable

    (@spiritvegetable)


    Hello,

    My portfolio shortcode seems to be not working. I’m following the instruction posted here:
    https://en.support.wordpress.com/portfolios/portfolio-shortcode/

    I just started a fresh WordPress site (blask template) and only installed Jetpack so far, activated Custom Content Types and managed to successfully embed a portfolio on a page I wanted (the intended result will have the portfolio spread over 3 pages/categories). However, aside from showing the portfolio on default settings, none of the code is doing anything:

    [portfolio display_types=true display_tags=true include_type=Music include_tag=Music columns=3 showposts=1 orderby=title order=asc]

    Type/tags are not displayed or filtered, there are now 4 columns, more than 1 post (I only did this as a test) and the order is also default. Any ideas, helpful hints?

    Thank you,

    Tom

Viewing 15 replies - 1 through 15 (of 15 total)
  • Hi @spiritvegetable!

    It sounds (and looks, if I check this page) like you might have your page set to use Blask’s Portfolio Page template, which will pull in all portfolio projects and override your content/shortcode completely.

    Try editing the page and setting it to the Default Template, and let me know if that does the trick 🙂

    If not, you’ll likely want to check in with the Jetpack experts!

    Thread Starter spiritvegetable

    (@spiritvegetable)

    Oh wow that totally fixed it! Thanks for that! The small details that one has no idea about..

    T

    Yay! Glad it’s working 🙂

    Thread Starter spiritvegetable

    (@spiritvegetable)

    Ok, so now that we’ve fixed one problem, another has cropped up (yay!).

    The portfolio template keeps the page tidy with just the featured images with rollover titles (linking to the project page).
    The default template on the other hand has no rollovers, instead the title is under each respective image and the text from each is project is showing under as well.

    Can I have the best of both worlds? The aesthetics/rollovers of the portfolio template but the organization of the default template?

    T

    Hm. The best solution that comes to mind at the moment would be to use the built in archive pages for project types and tags, like this one:

    http://tomprilesky.com/project-type/music/

    That uses the default post order, so you might want to modify that based on your previous shortcode usage.

    Creating a child theme, and adding this to the CSS should do the trick to reverse the Music project type order:

    add_action( 'pre_get_posts', 'custom_reverse_post_order' );
    function custom_reverse_post_order( $query ) {
    	if ( is_admin() )
    		return;
    	if ( is_archive() &&  $query->query_vars['jetpack-portfolio-type'] == 'music' ){
    		$query->set( 'orderby', 'date' );
    		$query->set( 'order', 'ASC' );
    	}
    }

    You could modify it to include additional project types like this:

    add_action( 'pre_get_posts', 'custom_reverse_post_order' );
    function custom_reverse_post_order( $query ) {
    	if ( is_admin() )
    		return;
    	if ( is_archive() && ( $query->query_vars['jetpack-portfolio-type'] == 'music' || $query->query_vars['jetpack-portfolio-type'] == 'second-project-type' || $query->query_vars['jetpack-portfolio-type'] == 'third-project-type' ) ){
    		$query->set( 'orderby', 'date' );
    		$query->set( 'order', 'ASC' );
    	}
    }
    Thread Starter spiritvegetable

    (@spiritvegetable)

    Aha! Another brilliant solution. Thanks Chad, that totally did what I wanted.

    Don’t really know the details on creating a child theme, but I’m sure the info is out there so I’ll look it up.

    Best,

    T

    I meant to link that over to this page for you:

    https://codex.ww.wp.xz.cn/Child_Themes

    Glad to hear it’s got the look you were going for!

    Thread Starter spiritvegetable

    (@spiritvegetable)

    Yup! Thanks for the link.

    Now to figure out how to make my link: http://tomprilesky.com/project-type/music/

    Each time I try to edit it, it condenses it to: http://tomprilesky.com/project-typemusic/

    Gah. Learning lots here!

    Which link do you mean? The one in the menu on the left?

    You should be able to edit that through Appearance > Menus, or is this a different link? 🙂

    Thread Starter spiritvegetable

    (@spiritvegetable)

    Oh, great, that worked. It wasn’t so obvious with the menus.

    Seems like the only thing left do is the child theme and I should be sorted!

    T

    Awesome! Enjoy 🙂

    Thread Starter spiritvegetable

    (@spiritvegetable)

    Sorry, one last question. I have the child theme installed and am trying to figure out where to put the CSS.
    When I use the CSS editor there is a menu for ‘additional CSS’. Putting the code in there does nothing. And yes the child theme is activated and I am for sure editing it and not the parent.

    I can copy over a bunch of files from the parent that have ‘portfolio’ in the title. Is it one of these that I must edit?

    portfolio-page.php
    taxonomy-jetpack-portfolio-type.php
    archive-jetpack-portfolio.php
    template-parts/content-portfolio-archive.php
    template-parts/content-portfolio-single.php

    Thanks so much!

    T

    AH. I’ll admit I was a little baffled because I couldn’t remember us working with any CSS so far. Then I found the error in my previous post.

    CSS is not what I meant to say there, sorry!

    Add that code in your child theme’s functions.php file. It’s a PHP filter that alters the order of the post query – so the additional CSS editor has no idea what to do with it.

    Sorry again! Let me know how it works once you save that to the functions.php file 🙂

    Thread Starter spiritvegetable

    (@spiritvegetable)

    Thanks again Chad! That did the trick.

    Best,

    T

    My pleasure! 🙂

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Portfolio Shortcode not working’ is closed to new replies.