Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1430240

    Hello.

    We have created and activated an Enfold Child on our website https://montealbertia.eus/
    Everything works correctly, except that when we search for a page, article or image in the media in the WordPress administrator, it does not find the requested file. This does not happen with the normal Enfold theme.

    What can we do to solve it?

    Thank you.

    #1430719

    Hey aintzerga,

    Thanks for the login details. If things are working as they should when the parent theme is active, then it’s likely that something you have added to the child is causing the problem. Please try to remove all customisations, then add them back one by one to see when the problem starts.

    Best regards,
    Rikard

    #1431273

    The truth is that I am not a computer expert and I have little knowledge about it.

    These are the customization concepts of the Child theme:

    <?php

    /*
    * Add your own functions here. You can also copy some of the theme functions into this file.
    * WordPress will use those functions instead of the original functions then.
    */

    function avf_alb_supported_post_types_mod( array $supported_post_types ) {
    $supported_post_types[] = ‘proyectos_ma’;
    return $supported_post_types;
    }
    add_filter(‘avf_alb_supported_post_types’, ‘avf_alb_supported_post_types_mod’, 10, 1);

    function avf_metabox_layout_post_types_mod( array $supported_post_types ) {
    $supported_post_types[] = ‘proyectos_ma’;
    return $supported_post_types;
    }
    add_filter(‘avf_metabox_layout_post_types’, ‘avf_metabox_layout_post_types_mod’, 10, 1);

    function include_cpt_search( $query ) {
    if ( $query->is_search ) {
    $query->set( ‘post_type’, array( ‘post’, ‘page’, ‘proyectos_ma’ ) );
    }
    return $query;
    }
    add_filter( ‘pre_get_posts’, ‘include_cpt_search’ );

    WHAT COULD BE THE ERROR?

    #1431286

    Hi,

    Thank you for the update.

    What happens when you remove the pre_get_posts filter or the whole include_cpt_search function? It seems to be altering the default search query.

    add_filter( ‘pre_get_posts’, ‘include_cpt_search’ );
    

    Best regards,
    Ismael

    #1431382

    If we delete the code, WordPress generates this error and the website cannot be accessed:

    Parse error: syntax error, unexpected end of file in /furanet/sites/montealbertia.eus/web/htdocs/wp-content/themes/enfold-child/functions.php on line 26

    #1431383

    The child theme was created to be able to use the Enfold visual layout designer in the new custom post type: projects_ma

    #1431459

    Hi,

    Thank you for the update.

    Please make sure to remove the add_filter (pre_get_posts) and the include_cpt_search function altogether.

    function include_cpt_search( $query ) {
    if ( $query->is_search ) {
    $query->set( ‘post_type’, array( ‘post’, ‘page’, ‘proyectos_ma’ ) );
    }
    return $query;
    }
    add_filter( ‘pre_get_posts’, ‘include_cpt_search’ );
    

    was created to be able to use the Enfold visual layout designer in the new custom post type: projects_ma

    The filter avf_alb_supported_post_types should be enough to enable the Advance Layout Builder for the custom post type (projects_ma).

    Best regards,
    Ismael

    #1431695

    OK Thanks. Now is OK

    #1431729

    Hi,

    Great! Glad to know that this has been resolved. Please feel free to open another thread if you have more questions about the theme.

    Have a nice day.

    Best regards,
    Ismael

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Error searching with Enfold child’ is closed to new replies.