Forums Forums Search & Filter Pro Post in Search page

Viewing 5 posts - 21 through 25 (of 25 total)
  • Trevor
    #234237

    Ah, I think I see. He is saying that $post is the entire post array of data, so …

    add_action('multilingualpress.metabox_after_update_remote_post', 'mlpress_post_saved', 10, 2);
    
    function mlpress_post_saved($relationshipContext, $post) {
        $post_ID = $post->ID;
        do_action('search_filter_update_post_cache', $post_ID);
    }

    So, that, from what they say, should work.

    You should be using a child theme, and place that code at the end (on a new line) of the functions.php file you would find i the child theme folder.

    Then test it by importing a post and see if it appeared in the search results.

    Anonymous
    #234239

    For the moment it seems that it works even if I didn’t add this code. Do I let like it is or do I have to change something? Because I don’t think that a use a child theme. Thanks

    add_action(‘multilingualpress.metabox_after_update_remote_post’, ‘mlpress_post_saved’, 10, 2);

    function mlpress_post_saved($relationshipContext, $post) {
    $post_ID = $post->ID;
    do_action(‘search_filter_update_post_cache’, $post_ID);

    Trevor
    #234243

    Be careful if you do not use a child theme. any files you edit, such as the functions.php file and the style.css file (and any template files you make or edit), will be overwritten and lost with new versions if you update the theme. Using a child theme avoids this.

    Also be careful copying code from our forum. You will notice that I post code inside a code box in the posts(use a back tick before and after the code)? Code you see in an open post and in emails will have been altered (characters changed), so be wary.

    Anonymous
    #234484

    Thank you for the advice. I created the themify-shoppe-child folder with style.css and functions.php files.
    The content of functions.php is: (and looks like it’s working!). Thanks.

    <?php
    /**
    ** activation theme
    **/
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
     wp_enqueue_style( 'parent-style', get_template_directory_uri() . 'https://cdn2.wpformation.com/style.css' );
    
    }
    add_action('multilingualpress.metabox_after_update_remote_post', 'mlpress_post_saved', 10, 2);
    
    function mlpress_post_saved($relationshipContext, $post) {
        $post_ID = $post->ID;
        do_action('search_filter_update_post_cache', $post_ID);
    }
    Trevor
    #234494

    Thanks for getting back to me. I will close this thread for now.

Viewing 5 posts - 21 through 25 (of 25 total)