i am trying to make your plugin work as replacement for the wordpress standard search. I use the latest WP version 6.1.1
Your plugin looks good, but I have one irritating problem. For unknown reasons, the selection “ascending/descending” is not working, at least not with dates.
Independent of what I select in “Search Result Order”, the search always shows the oldest entries first, so I guess “ascending”. I am unable to get the newest dates first, as it should be. And yes, i *have* saved the setting and yes, i *have” the correct setting name selected when testing.
I don′t expect this to be a bug in your plugin, this would too obvious. But I have no idea where to look elsewhere, what might cause that problem. Any faint idea?
Thanks!
]]>Your plugins are too useful, thanks!
I would like to know if it is possible to search & replace only in descending pages:
Page 1
-SubPage1
-SubPage2
-SubPage3
Page 2
Page 3
…
I would like to replace a Shortcode only on page 1 and in all of its subpages, is this possible?
– – – –
Why this Workflow?
I have a page flow, a funnel, and if that works, I won’t need to replace information and shortcodes on every page …
Thanks for listening.
]]>It only displayed the last 10 child pages for me, and they were in descending order of creation.
Can you get this changed please to add all child pages, and in ascending order?
Thanks.
]]>The type of page I want to sort is here: https://www.georgeglazer.com/wpmain/product-category/press-clippings-exhibitions/ As you can see, the titles begin with a year. We want to show the most recent events first, i.e. a title beginning “2020” would be first, followed by titles beginning “2019,” “2018,” etc. In the near future, this page will be broken into subcategories, so it would be good to know how to assign two or more categories to whatever code will accomplish this.
I already have the following custom code in my Child Theme to make default sorting of products in all categories alphabetical, ascending order. I assume something gets added to this code, which works fine:
* * * * *
// DEFAULT PRODUCT SORTING ALPHABETICALLY //
add_filter( ‘woocommerce_get_catalog_ordering_args’, ‘custom_woocommerce_get_catalog_ordering_args’ );
function custom_woocommerce_get_catalog_ordering_args( $args ) {
$orderby_value = isset( $_GET[‘orderby’] ) ? woocommerce_clean( $_GET[‘orderby’] ) : apply_filters( ‘woocommerce_default_catalog_orderby’, get_option( ‘woocommerce_default_catalog_orderby’ ) );
if ( ‘alphabetical’ == $orderby_value || ‘menu_order’ == $orderby_value ) {
$args[‘orderby’] = ‘title’;
$args[‘order’] = ‘ASC’;
}
return $args;
}
add_filter( ‘woocommerce_default_catalog_orderby_options’, ‘custom_woocommerce_catalog_orderby’ );
add_filter( ‘woocommerce_catalog_orderby’, ‘custom_woocommerce_catalog_orderby’ );
function custom_woocommerce_catalog_orderby( $sortby ) {
$sortby[‘alphabetical’] = __( ‘Sort by A to Z’ );
return $sortby;
}
* * * * *
In doing the research on this subject I found this article about ascending vs. descending vs. random order:
https://docs.woocommerce.com/document/custom-sorting-options-ascdesc/
/**
* Add custom sorting options (asc/desc) */
add_filter( ‘woocommerce_get_catalog_ordering_args’, ‘custom_woocommerce_get_catalog_ordering_args’ );
function custom_woocommerce_get_catalog_ordering_args( $args ) {
$orderby_value = isset( $_GET[‘orderby’] ) ? wc_clean( $_GET[‘orderby’] ) : apply_filters( ‘woocommerce_default_catalog_orderby’, get_option( ‘woocommerce_default_catalog_orderby’ ) );
if ( ‘random_list’ == $orderby_value ) {
$args[‘orderby’] = ‘rand’;
$args[‘order’] = ”;
$args[‘meta_key’] = ”;
}
return $args;
}
add_filter( ‘woocommerce_default_catalog_orderby_options’, ‘custom_woocommerce_catalog_orderby’ );
add_filter( ‘woocommerce_catalog_orderby’, ‘custom_woocommerce_catalog_orderby’ );
function custom_woocommerce_catalog_orderby( $sortby ) { $sortby[‘random_list’] = ‘Random’;
return $sortby;
}
* * * * *
And I found this article about changing the default sorting for a specific category, but it’s not exactly what I want to do because it doesn’t address the order, just the type of sorting (by date, by popularity, etc.). Also note that sorting by date means the date that the product was added to the site, not the date in the title:
https://webhostingbuddy.com/blog/woocommerce-default-sort-method-for-specific-category/
//custom function to override default sort by category
function custom_default_catalog_orderby() {
//choose categories where default sorting will be changed
if (is_product_category( array( ‘category1’, ‘category2’, ‘category3’ ))) {
return ‘date’; // sort by latest
}else{
return ‘popularity’; // sort by popularity as the default
} // end if statement
} //end function
add_filter( ‘woocommerce_default_catalog_orderby’, ‘custom_default_catalog_orderby’ ); //add the filter
* * * * *
I should mention that I don’t really understand PHP, although I can use common sense to see what the patterns are. In other words, give me a recipe and I can probably follow it.
–Helen
]]>I want to have the next upcoming event at the top of the list (ASC), not the bottom (DESC).
Here is the relevant code in event-meta-event-single.php
<?php if ( eo_recurs() ) {
//Event recurs - display dates.
$upcoming = new WP_Query(array(
'post_type' => 'event',
'event_start_after' => 'today',
'posts_per_page' => -1,
'event_series' => get_the_ID(),
'group_events_by' => 'occurrence',
));
if ( $upcoming->have_posts() ) : ?>
<br><br><strong><?php _e( 'Upcoming Dates', 'eventorganiser' ); ?>:</strong>
<ul class="eo-upcoming-dates" style="margin-top:10px">
<?php
while ( $upcoming->have_posts() ) {
$upcoming->the_post();
echo '<li>' . eo_format_event_occurrence() . '</li>';
};
?>
</ul>
<?php
wp_reset_postdata();
//With the ID 'eo-upcoming-dates', JS will hide all but the next 5 dates, with options to show more.
wp_enqueue_script( 'eo_front' );
?>
<?php endif; ?>
<?php } ?>
<?php do_action( 'eventorganiser_additional_event_meta' ) ?>
</div>
]]>i used the code which is given in the documentation and putted it in the fuctions.php of my theme. I want to order by event start date (ascending). The most events are ordered correctly but some events arent.
For example the first three events are orderd like this:
1. 01.07.2020
2. 04.05.2020
3. 06.05.2020
Thank you in advance
Giacomo
With the voting process, we’ll be building a top 100 items list, so I’d like the items with the most votes to go on top (a descending list).
I have it set so that results get ordered this way, but the list of choices for voting are being displayed in the order they were entered (so it’s all mixed in order).
Is there a way to get the choices for voting in descending order based on number of votes already received?
Thanks!
]]>thanks for your help
]]>First of all, thanks for a good and useful plugin.
Some questions have arisen when using the plugin.
1. How to make a good structure. As you can see on the page I’ve linked to, there is no structure. I would like an alphabetical order in descending direction. What code can I use to achieve this?
2. Further, I only wish 1 column on the mobile version. How can this be changed?
Best regards
Kristian