• Resolved Subrata Sarkar

    (@subrataemfluence)


    My search result page has a filter dropdown with all Post Types including cool_timeline.

    <select name="post_type">
     <option value="">All Content Types</option>
     <option value="post">Posts</option>
     <option value="page">Pages</option>
     <option value="cool_timeline">Timeline Stories</option>
     <option value="product">Products</option>
     <option value="event">Events</option>
     <option value="resource">Resources</option>
    </select>

    The code that creates the above dropdown is as follows:

    <select name="post_type">
      <option value="">All Content Types</option>
      <?php foreach (get_post_types(['exclude_from_search' => false], 'objects') as $post_type) : ?>
      <?php if ($post_type->name !== 'attachment') : ?>
      <option value="<?php echo $post_type->name ?>"
           <?php if (isset($_GET['post_type']) && $_GET['post_type'] === $post_type->name) echo 'selected' ?>
                    ><?php echo $post_type->labels->name ?></option>
                <?php endif ?>
            <?php endforeach ?>
        </select>

    Timeline Stories are displaying fine in the search result, but all content type filters are working perfectly (i.e. filtering the result properly based on selected post type and presenting the new filtered result) except cool_timeline. When I use this filter, the result page jumps back to site’s homepage.

    Search result page screenshot

    I looked into all templates but did not find anything that can cause this. I have gone completely clueless!

    The site is built with a custom Block theme and using full site Editing.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support aniketji

    (@aniketji)

    Hi @subrataemfluence,

    It’s correct: cool_timeline. If you have queries related to our plugin Cool Timeline, then we can assist you with that. However, if you are asking about custom work, then we are unable to help you at the moment.

    Thank you.

    Thread Starter Subrata Sarkar

    (@subrataemfluence)

    Hi @aniketji, thank you for your reply. I am not asking for any custom support! All I want to know is whether there is any additional settings that need to be set up inside the plugin for the above to work correctly.

    Because, it is very strange that all except cool_timeline filter is not working!

    Thank you!

    Plugin Support aniketji

    (@aniketji)

    Hi @subrataemfluence,

    Sorry, but there is no setting for this type of functionality.

    Thank You.

    Thread Starter Subrata Sarkar

    (@subrataemfluence)

    Hi @aniketji, the problem lies here, in cool-timeline-pro/admin/class-cool-timeline-posttype.php.

    function ctl_template_redirect()
    {
       if(is_post_type_archive('cool_timeline' ))
       {
          wp_redirect( home_url( '/' ) );
          exit();
       }
    }

    I don’t really understand the purpose of this forced redirection. I have to comment out the function body in order to get search page to post back on itself and bring me the desired filtered result!

    However, I also understand that updating the plugin will overwrite this!

    If this is done on purpose, i would love to know the use case. Otherwise, I feel this can be omitted or rewritten to overcome the problem. Because, a search can easily be a requirement since timeline is registered as a post type like page and post!

    Thank you!

    Plugin Support aniketji

    (@aniketji)

    Hi @subrataemfluence,

    Good to here about that you find the issue at your end and fixed it. we will check this and let you know the use of this, for now you are pro user of the plugin, you can contact us on pro plugin support page for futhre discussion.

    https://coolplugins.net/support/

    Thank you.

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