-
AuthorPosts
-
January 9, 2016 at 6:34 am #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
January 10, 2016 at 1:52 am #562554Hey torndownunit!
Try line 38 in the /enfold/includes/admin/register-portfolio.php file.
'supports' => array('title','thumbnail','excerpt','editor','comments')
Best regards,
ElliottJanuary 30, 2016 at 4:05 pm #575023Hi, 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
February 1, 2016 at 3:52 am #575502Hey!
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,
ElliottFebruary 2, 2016 at 2:43 pm #576434Hey, 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.
February 4, 2016 at 5:49 am #577568Hey!
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,
IsmaelFebruary 4, 2016 at 11:37 pm #578121Thanks. Jetpack is working fine with general posts. So it’s still specifically Portfolio posts that have the issue.
February 6, 2016 at 4:31 am #578942Just 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!
February 8, 2016 at 7:18 am #579387 -
AuthorPosts
- You must be logged in to reply to this topic.