[Support request] Specific content padding for CPT posts

Home Forums Support [Support request] Specific content padding for CPT posts

Home Forums Support Specific content padding for CPT posts

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1662880
    Jesus

    Hello, I have succesfully set the general content padding in Appearance > Customize > Layout > Container, but I have a Custom Post Type and I would need a specific padding for the CPT single entries only. I had thought about adding some specific wrappers for the CPT and using them to create a specific CSS rule, but I wonder if there is a cleaner way to achieve it. Thanks.

    #1662910
    Elvin
    Staff
    Customer Support

    Hi there,

    You can use the option_generate_blog_settings and other filters to change the layout etc for specific pages/posts/post types.
    https://docs.generatepress.com/article/option_generate_blog_settings/

    Example:

    add_filter( 'option_generate_blog_settings', 'lh_custom_search_results_page_settings' );
    function lh_custom_search_results_page_settings( $options ) {
     if ( is_single() && get_post_type( get_the_ID() ) == 'slug_custom_post_type' ) {
          return $options;
        }
    }
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.