CPT not shown on AMP startpage

Posted in: Newspaper
Post count: 209

Hello,
I have a custom post type “podcast”. On the AMP version of the startpage those CPT is not displayed in the latest post list. I have AMP plugin installed and use the mobile theme for AMP pages. How can I enable CPT in that list?
https://www.literaturcafe.de/?amp=1

Post count: 21065

Hello!

Unfortunately, you can not filter which type of posts to display in the Mobile Theme layout.

Thank you!

Post count: 209

But can I edit/hack the theme somewhere to ad my CPT?

Post count: 21065

Hello!

This will require custom work which is not covered by the support team.
For customization and other services you can contact our custom work team here: https://tagdiv.com/premium-customization-services/

Thank you for understanding!

Post count: 209

Hello,

just in case someone has the same problem, here is the solution to add Custom Post Types into the loop of AMP-Pages. Of course this has to be done after every theme-update.

In /wp-content/plugins/td-composer/mobile/functions.php add the following function:

function add_custom_post_type_to_query( $query ) {
if (is_home() || is_archive()) {
$query->set( 'post_type', array('post', 'your_CPT_name_here') );
}
}
add_action( 'pre_get_posts', 'add_custom_post_type_to_query' );

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.