WPFTS Pro Main Site WPFTS Community Forum
    • Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. Lifeboy
    Get WPFTS Pro today with 25% discount!
    L
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Groups 0

    Lifeboy

    @Lifeboy

    0
    Reputation
    1
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    Lifeboy Unfollow Follow

    Latest posts made by Lifeboy

    • RE: Indexing add-on blocks

      Here is the accordion.php code that creates the faq entries.

      accordion.php.txt

      I added the code from the documentation to my function.php in the child theme, but of course this is not a post type I'm dealing with, but a page with an add-on.

      /**
       * This snippet adds metadata of "employee" post to search index
       */ 
      add_filter('wpfts_index_post', function($index, $post)
      { 
          global $wpdb;
      
          // Basic tokens 
          /* 
           * This piece of code was commented out intentionally to display things
           * which was already done before in the caller code
          $index['post_title'] = $post->post_title;
          $index['post_content'] = strip_tags($post->post_content);
          */
          if ($post->post_type == 'employee') {
              // Adding new token "employee_data" specially for posts of type "employee"
              $data = array(); 
              $data[] = get_post_meta($post->ID, 'address', true);
              $data[] = get_post_meta($post->ID, 'phone', true); 
              $data[] = get_post_meta($post->ID, 'name', true);
              $data[] = get_post_meta($post->ID, 'function', true);
              $index['employee_data'] = implode(' ', $data);
          } 
          return $index; 
      }, 3, 2);
      
      posted in General Discussion
      L
      Lifeboy
    • Indexing add-on blocks

      I'm using WP Page Editor's Accordion addon block to create an FAQ page. However, the contents of this page is not indexed at all.

      Screenshot 2023-11-07 112022.png

      Why is this and how can I change this behaviour?

      posted in General Discussion
      L
      Lifeboy