Tagged: ,

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #562322

    I was looking into how to add the theme’s Portfolio posts to Jetpack Publicize feature. I found this article:

    Jetpack 2.8: Introducing Markdown and Improving Monitor

    For our developer friends out there, we’ve added Publicize support for custom post types, allowing you and your clients to automatically post new entries from any CPT to your social media networks. You’d need to make one small tweak in the code defining the CPT—just add ‘publicize’ to the CPT’s ‘supports’ array.

    For example, to enable the title, editor, Publicize, and Jetpack’s new support for Markdown: ‘supports’ => array( ‘title’, ‘editor’, ‘publicize’, ‘wpcom-markdown’ ),

    Could you tell me where in the theme files I do the code edit they are describing?

    Thanks

    #562554

    Hey torndownunit!

    Try line 38 in the /enfold/includes/admin/register-portfolio.php file.

    'supports' => array('title','thumbnail','excerpt','editor','comments')
    

    Best regards,
    Elliott

    #575023

    Hi, I am a bit late getting back to this.

    So working with a child theme, does that mean I need to make a folder in it /includes/admin , then have a file register-portfolio.php with the code change to line 38?

    Thanks

    #575502

    Hey!

    If you want to do it in a child theme then you can use a filter in your functions.php file, https://kriesi.at/support/topic/enfold-theme-sort-portfolio-items-for-real-estate-website/#post-348286.

    Regards,
    Elliott

    #576434

    Hey, did you link the wrong post by any chance? Unless I am missing something on that page, I don’t see anything amongst all the snippets there related to what we are talking about. Maybe I am missing it. All those posts seems related to customizing the actual portfolio posts content, not enabling something like Publicize on them. Thanks!

    I was able to make the checkboxes for Publicize show up on a portfolio post using the first edit mentioned (not using a child), but they are greyed out and can’t be checked off.

    It would be awesome if in an update the Portfolio posts could get Publicize support. I am trying in my case to have any updates to my portfolio automatically post to social media (using Publicize), I think others would find that feature useful. To workaround right now, I have to make a Post with a link to the Portfolio post.

    Thanks.

    #577568

    Hey!

    The first filter on the link we provided should alter the supports parameter of the portfolio cpt:

    add_filter('avf_portfolio_cpt_args', 'avf_portfolio_add_custom_fields', 1);
    function avf_portfolio_add_custom_fields($args) {
    	$args['supports'][] = 'publicize';
    	return $args;
    }

    Please contact the plugin author for more info regarding the greyed-out check box.

    Regards,
    Ismael

    #578121

    Thanks. Jetpack is working fine with general posts. So it’s still specifically Portfolio posts that have the issue.

    #578942

    Just an update. After logging out and back into my site today, new Portfolio posts will now work with Publicize. So if anyone is looking for the same solution, it was the last filter that Ismael suggested that worked. It was added to the function.php of my child theme.

    Thanks!

    #579387

    Hi,

    Thanks for the feedback, much appreciated!

    Thanks,
    Rikard

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.