Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1028435

    In the default category of my blog are shown the pages (post type: “page”) how is this possible?
    Can someone give me a suggestion to solve this problem?
    thanks a lot
    Rodolfo

    #1028749

    Hey Foffo75,

    Where can we see the problem?

    Best regards,
    Rikard

    #1028789

    Hey Rikard ,
    https://agenziamatrimonialefirenze.com/amore/

    The first two are articles, the following are all random pages. The strange thing is that this error only occurs in the default category.

    Best regards,
    Foffo75

    #1029325

    Hi Foffo75,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #1029849

    Hi Vittoria, if you give me an email address I’ll send you access.
    Best regards,
    Foffo75

    #1029851

    Hi Vittoria,
    here are the credentials.
    Best regards,
    Foffo75

    #1030879

    hey group!
    no one who can help me?
    thanks a lot

    #1031500

    Hi,

    I’m sorry for the late response. This filter should help exclude the pages post type from the archive pages.

    function ava_exclude_pages( $query ) {
        if ( is_admin() || ! $query->is_main_query() ) return;
    
        if ( $query->is_archive() ) {
            if ( array_key_exists( 'category', $query->tax_query->queried_terms ) ) {
                $query->set('post_type','post'); 
            }
        }
    }
    add_action( 'pre_get_posts', 'ava_exclude_pages' );

    Best regards,
    Ismael

    #1031614

    Hi ismael, meanwhile, thanks for the support. The filter where should be added precisely in archive.php? or in function.php?
    Thanks again
    Foffo75

    #1031935

    Hi,

    Please try it at the very bottom of your child theme functions.php file.

    Best regards,
    Rikard

    #1032638

    Hi,
    the filter works correctly only if I insert it in the mother thema. In the Child it does not work .

    Best regards,
    Foffo75

    #1033316

    Hi,

    That’s odd. Can we access the site again? The previous login info is not working anymore.

    Best regards,
    Ismael

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.