- This topic has 10 replies, 2 voices, and was last updated 6 years, 2 months ago by Tom.
-
AuthorPosts
-
February 8, 2018 at 8:43 am #491422drew
I’m trying to use a JetPack custom post type (Projects) and have discovered that it’s layouts aren’t applying inside GP.
Example: single projects page inside GP http://amarillosymph.staging.wpengine.com/artists/chris-rogerson/
- the sidebar layout for “posts” is being applied
- none of the post’s layout settings are being applied
Here’s the same custom post type page on the install currently using a non-GP theme: http://amarillosymphony.org/artists/chris-rogerson/
I found an old thread here from 2016 where someone mentioned using a child theme, which I really hope can be avoided, but in the end, how can I get JetPack’s layout and custom post type functionality to apply?
Many thanks,
DrewP.S. I went through TOm’s snippets but didn’t see anything.
February 8, 2018 at 4:03 pm #491702TomLead DeveloperLead DeveloperHi Drew,
Does Jetpack assume the HTML structure, or is there anywhere you can apply your own structure?
GP needs a specific structure for the content area and sidebars.
Let me know ๐
February 8, 2018 at 4:08 pm #491708drewI wish I knew the answer but that’s going to be just enough past my skill ceiling to know.
February 9, 2018 at 12:09 am #491879TomLead DeveloperLead DeveloperHave you tried using the shortcode?: https://en.support.wordpress.com/portfolios/portfolio-shortcode/
That way you can just use a regular page.
February 9, 2018 at 5:07 am #492072drewYes, the shortcodes that produce the index pages appear to be working fine,
The trouble is with the individual posts. Their default formatting places the featured image in a left column and the post’s title, taxonomy meta, and copy in a right column.
It’s that layout which isnโt rendering.
February 9, 2018 at 7:08 am #492246drewWell here’s an interesting update. I tried completely disabling the custom post type, then disabling Jetpack, removing all of the autoloaded data from wp_options, then activating everything again. Now the single post layouts are being recognized.
There was a need to add this CSS to remove the featured image from showing at the top (even though featured images for posts was deactivated in settings):
/*REMOVE FEATURED IMAGE FROM JETPACK PROJECTS SINGLE PAGE*/ .single-project .single-featured { display: none; }
the only other oddity is the per post layout settings were being ignored. For example, I had the default Post layout as Content:Sidebar but had the layout>sidebars on each custom post type set to “Content (no sidebars)” – unfortunately, the right sidebar was still being displayed on the front end.
Which means I now have to reverse engineer everything and manually set each individual default post layout to content:sidebar unless you have an idea about how to correct that.
Drew
February 9, 2018 at 7:48 pm #492660TomLead DeveloperLead DeveloperWeird, I wonder what’s going on with their code..
We can use a filter to target the sidebar layout for that post type:
add_filter( 'generate_sidebar_layout', 'tu_single_cpt_sidebar_layout' ); function tu_single_cpt_sidebar_layout( $layout ) { // If we are on a category, set the sidebar if ( is_singular( 'artists' ) ) { return 'no-sidebar'; } // Or else, set the regular layout return $layout; }
You can find the available values here: https://docs.generatepress.com/article/sidebar-layout/#using-a-function
February 10, 2018 at 1:21 am #492767drewMany thanks, this is probably Jetpack’s last straw for me; I found another thread here where you’re pointing out the value of simply creating a CPT and after finding a plugin that migrates meta from one CPT to another, I’m finding that it brings over everything except the non-feature image gallery images. All things being equal, having one more reason to be rid of Jetpack is a good thing!
February 10, 2018 at 9:49 am #493051TomLead DeveloperLead DeveloperI agree, I’m not a big fan of Jetpack at all. CPTs are generally pretty simple ๐
February 10, 2018 at 10:05 am #493074drewI’ll certainly put in a plug here for your Lightweight social media plugin: https://generatepress.com/lightweight-social-icons/
It’s a critical plugin for anyone looking for a Jetpack “cut the cord” option!
February 10, 2018 at 9:01 pm #493345TomLead DeveloperLead DeveloperThanks! ๐
-
AuthorPosts
- You must be logged in to reply to this topic.