The custom post does not display Jetpack share buttons
-
The custom post does not display Jetpack share buttons
After creating and configuring the custom post, I created some posts and the Jetpack feature that displays share buttons is not displayed.
I already checked the “Show share buttons” option on the JetPack button inside the post, and it is checked.
-
Not sure offhand, and I can’t recall what conditions are needed for those to show for a custom post type. May be worth checking Jetpack’s support areas as well in case others have had issues with CPTs and those buttons. Though I think there may have been a thread or two in the past in our forum about it as well.
The custom post I created does not display many features, such as: comments, related posts, share buttons, links to taxonomies, etc.
Se a custom post here:
https://capixabamassa.com/empresas/farmacia-e-manipulacao-montanha/And See a normal Post:
https://capixabamassa.com/forca-tatica-detem-duas-pessoas-com-armas-de-fogo-em-pinheiros/Part of it is going to be potentially differences in template files. Not sure if you’ve already set up a custom single-empresas.php file already, or if both of those is falling back to single.php
01 – I created a type of post called “companies”.
02 – I made a copy of the file “single.php” for the root of the child theme and renamed it to “single-companies”.
Within this file I renamed the line:
————————————–
get_template_part (‘content’, ‘single’;
————————————–
for:
————————————–
get_template_part (‘content’, get_post_type ());
————————————–03 – I also made a copy of the file “content-single.php” for the root of the child theme and renamed it to “content-companies.php”
04 – I’m using the “Generatepress” theme.
One thing I noticed is that the “pages” on the website also do not display these jetpack features.So it seems to me that my types of personalized posts are behaving like “Pages” and not like “Posts”. can this be?
If it’s not working for standard pages, then either something isn’t quite right with the Jetpack settings, or some aspect of the theme files aren’t right for both pages and anything not standard posts, wherein Jetpack doesn’t have the parts it needs available to hook in, to output its sharing details.
Not sure if GeneratePress support has any experience with getting this working with their product(s) but may be worth reaching out to them as well.
I checked again on the standard pages. and the comments are appearing, “I had unchecked the option. What does not appear in the personalized post are share buttons and related posts.
Trying to check the Jetpack code on my end, and i’m seeing something about global options and some “show” array which I have to assume is a setting of what post types to show things on.
I assume there’s no post meta already that says to disable, as you’re just getting started on things, and I have to assume they’re published, non private posts.
Those are the biggest blockers I can find to things not showing.
Hello. Could you tell me the procedure you indicate for creating the files after creating a custom post type?
So I can try again using the form that the plugin developer indicates.
You already covered the intended/best way to do that in your reply from 12 hours ago, where you made
single-companies.php
and whatnot. Jetpack is trying to attach its output to thethe_content()
orthe_excerpt()
output, so if your templates in these cases don’t make use of those functions, then I could see it failing to output.01 – I didn’t quite understand what you said about: “the_content ()” and “the_excerpt ()”
If you can explain it better I would be grateful.02 – As I said earlier, the types of personalized posts “Seem” are being treated as “PAGES” and therefore are not showing some resources.
Could you tell me something about this?
Is there any configuration that I should do, or that I should select in your plugin so that the type of custom post created with your plugin is recognized by WordPress and consequently by JetPack as a “Post”?
It seems to me that the problem is there.
Those two functions are part of the WordPress loop. For example, I went to https://generatepress.com/install-generatepress/ and downloaded a copy of GeneratePress 2.4.2. Once I extracted the zip file, I opened
content-single.php
at around line 63 of that file, there’s a div with a class of entry-content, and on line 63 itself, a call tothe_content();
Whatever new files you created, you’ll want to make sure they also have a spot like this. If you have been duplicating instead of starting files blank and typing in parts, then you should probably already have them.
However, there’s still looking to be Jetpack settings regarding post types support, based on what I saw in their plugin files earlier. Those settings may be preventing things from showing up still.
This isn’t appearing, from what I can see, to be a matter of how the post type is “behaving” compared to a different default type, just a matter of “should Jetpack add this feature on this post type”
CPTUI doesn’t have settings for Jetpack, for what it’s worth.
I realize that this isn’t specifically for your case, but I am curious if the tutorial here will show you the necessary settings https://www.journeybytes.com/add-jetpack-share-to-wp-job-manager/
Hey, Look what happened now,
It sounds like a joke, But doesn’t.
I had already created several posts of the custom type, and all do not display the related JetPack posts
Behold, I created a new one, and it exhibited. the problem is that the old ones still didn’t show.
I then tried to modify an old post, with all the settings the same as the new one, and even then it does not display the related posts.
Analyzing the code I noticed that the posts in which it is not displayed, in the css there is a “display none” for the jetpack code, but even deactivating it, it does not display the related posts.
Honestly, I don’t know what else to do.
The Jetpack team doesn’t seem to be
interested in solving this bug.Follow the link of the new post you are displaying normally.
https://capixabamassa.com/empresas/tb-producoes/And the old post that I set up exactly the same, with the same categories and even the same cover image.
https://capixabamassa.com/empresas/delaitv-old/Not taking anything as a joke, but definitely trying to help here still. I want to get this solved for you.
I remembered I had an old un-used WP install, that happened to have Jetpack installed already, as well as CPTUI. I went in, created a brand new “movies” post type, and published a post with it. I also installed and activated GeneratePress. Originally, it wasn’t showing the share buttons for the movie post, but it was for a standard post, like we’ve generally established.
However, I went to Jetpacks settings, and the “Sharing” tab along the top. I made sure that the “Add sharing buttons to your posts and pages” setting was toggled on. I then clicked “Configure your sharing buttons” right below that. That should lead you to a url like https://wordpress.com/marketing/sharing-buttons/ with your current URL appended to the end to help identify which site was being configured for. If you scroll down, you should see an “Options” spot that lists “Show like and sharing buttons on” and your available post types. “Movies” was unchecked, so I checked it, and hit save. Then went back to my single movie post and refreshed the page. Suddenly, sharing buttons were there.
Can you try the same steps to see if you get similar results? The share button spot I saw on your links above, didn’t look like Jetpack’s stuff, it looked more native to your current theme more than anything.
Hey Michael,
just so I don’t get misunderstood.
When I talked about looking like a joke, I was referring to the fact that the problem came and went for no apparent reason.
??
I did what you asked for and the share buttons are now displayed.
however the related posts still don’t appear. mysteriously they are being displayed only in the post called “TB PRODU??ES”
- The topic ‘The custom post does not display Jetpack share buttons’ is closed to new replies.