• Resolved sarahjsouris

    (@sarahjsouris)


    Hello,
    Thanks in advance for your help.
    I have read your thread about displaying the sort order on the front end. I also copied the code snippets into our functions.php file (is that where they were supposed to go?). But I was unable to display the sort order on the front end in the same way that it looks using your plugin.

    We are using the Avada theme.

    Could you possibly help?
    Thanks so much!
    Sarah

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Aurovrata Venet

    (@aurovrata)

    I also copied the code snippets into our functions.php file (is that where they were supposed to go?).

    sure, but what code are you referring to? Can you paste the code in this thread.

    I was unable to display the sort order on the front end in the same way that it looks using your plugin.

    you mean the sort order in the backend?

    We are using the Avada theme.

    so my guess is that your theme is forcing its own order. Can you run a test and switch themes (use the WP twentytwenty theme for example) and see if your post appear in the expected order?

    THis will narrow it down

    Thread Starter sarahjsouris

    (@sarahjsouris)

    Hi @aurovrata

    Thank you for your reply. I appreciate it.

    I swapped themes and the sort order was correct (what it looks like in the backend). So you are right about the theme. What should I do about this?

    Previously, I put this code into the functions.php and it didn’t help.

    add_filter('rpwc2_allow_custom_sort_orderby_override', 'override_orderby_sorting', 10,5);
    function  override_orderby_sorting($override, $wp_query, $taxonomy, $term_id, $type){
        //check this is the correct query
        if($wp_query....){
          $override = true;
        }
        return $override;
    }

    When I put the following code in, I got a critical error and the site crashed.

    add_filter('reorderpwc_filter_multiple_post_type', 'filter_my_ranked_post_type', 10, 4);
    function filter_my_ranked_post_type($type, $post_types, $taxonomy, $wp_query){
      /* String $type post type to filter.
      *  String $post_types post types associated with taxonomy.
      *  String $taxonomy being queried.
      *  WP_Query $wp_query query object. */
      if('my-custom-tax' == $taxonomy && in_array('my-custom-post',$post_types)) $type = 'my-custom-post';
      return $type;
    }

    These code snippets were from your FAQ#10

    Thanks again!
    Sarah

    Plugin Author Aurovrata Venet

    (@aurovrata)

    When I put the following code in, I got a critical error and the site crashed.

    LOL! Yes, that is expected, the line which says:

    //check this is the correct query
        if($wp_query....){
          $override = true;
        }

    is meant to be coded in to identify your specific query, as it stands the code is wrong and will cause a fatal error.

    These code are meant to be a guide for a developer who knows that they are doing…not for beginners ??

    I swapped themes and the sort order was correct (what it looks like in the backend). So you are right about the theme. What should I do about this?

    so there can be several reasons which it is not working (as explained in FAQ #10. To get it to work you will need to get help from a developer. If you want my help please reach out to me on vrata at syllogic dot in

    Plugin Author Aurovrata Venet

    (@aurovrata)

    v2.12 will fix this

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Could you please help us display the sort order on the front end’ is closed to new replies.