Home Forums WoodMart support forum Blog page doesnt show posts

Blog page doesnt show posts

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #555984

    leitmotivmedia
    Participant

    Posts published do not appear on the blog page

    #555985

    leitmotivmedia
    Participant

    Access in private content

    #556192

    Hung Pham
    Keymaster

    Hi leitmotivmedia,

    Thanks for reaching to us.

    Would you mind if I deactivate extra plugins for testing? Please confirm me back.

    Regards,

    #556231

    leitmotivmedia
    Participant

    please, test, whatever you need

    #556489

    Hung Pham
    Keymaster

    Hi leitmotivmedia,

    Thanks for your confirmation.

    I switched to Parent theme and it worked again, so please remove custom code lines related to Blog page then check again.

    Regards,

    #556513

    leitmotivmedia
    Participant

    Thank you so much.
    It is true, the problem was a function that I have added in function.php
    It is a function for the URL of non -including sub folders
    That way instead of myysite.com/products/my-first-product
    The URL is mysite.com/my-first-product

    Can it be done in some way so that it does not affect the blog?

    /* Quitar producto del slug de productos de WooCommerce */
    function ayudawp_quitar_slug_producto( $post_link, $post, $leavename ) {
    if ( ‘product’ != $post->post_type || ‘publish’ != $post->post_status ) {
    return $post_link;
    }
    $post_link = str_replace( ‘/producto/’, ‘/’, $post_link );
    return $post_link;
    }
    add_filter( ‘post_type_link’, ‘ayudawp_quitar_slug_producto’, 10, 3 );
    function change_slug_struct( $query ) {
    if ( ! $query->is_main_query() || 2 != count( $query->query ) || ! isset( $query->query[‘page’] ) ) {
    return;
    }
    if ( ! empty( $query->query[‘name’] ) ) {
    $query->set( ‘post_type’, array( ‘post’, ‘product’, ‘page’ ) );
    } elseif ( ! empty( $query->query[‘pagename’] ) && false === strpos( $query->query[‘pagename’], ‘/’ ) ) {
    $query->set( ‘post_type’, array( ‘post’, ‘product’, ‘page’ ) );
    $query->set( ‘name’, $query->query[‘pagename’] );
    }
    }
    add_action( ‘pre_get_posts’, ‘change_slug_struct’, 99 );

    #556729

    Hung Pham
    Keymaster

    Hi leitmotivmedia,

    Unfortunately, additional customization is outside the scope of our basic support.

    Thanks for your understanding.

    Regards,

    • This reply was modified 8 months ago by Hung Pham.
Viewing 7 posts - 1 through 7 (of 7 total)