Change ordering of posts/topics
Quote from Asgaros on January 24, 2017, 12:51 pmThe available filters allow you to change the odering of your posts and topics. Here are a few code-example which you have to add to your themes functions.php file if you want to use them.
Show newest posts first in topic
function custom_asgarosforum_filter_get_posts_order($order) { $order = 'p1.id DESC'; return $order; } add_filter('asgarosforum_filter_get_posts_order', 'custom_asgarosforum_filter_get_posts_order');Show newest topics first in forum
function custom_asgarosforum_filter_get_threads_order($order) { $order = 't.id DESC'; return $order; } add_filter('asgarosforum_filter_get_threads_order', 'custom_asgarosforum_filter_get_threads_order');Show oldest topics first in forum
function custom_asgarosforum_filter_get_threads_order($order) { $order = 't.id ASC'; return $order; } add_filter('asgarosforum_filter_get_threads_order', 'custom_asgarosforum_filter_get_threads_order');Sort topics in forums by name
function custom_asgarosforum_filter_get_threads_order($order) { $order = 't.name ASC'; return $order; } add_filter('asgarosforum_filter_get_threads_order', 'custom_asgarosforum_filter_get_threads_order');
The available filters allow you to change the odering of your posts and topics. Here are a few code-example which you have to add to your themes functions.php file if you want to use them.
Show newest posts first in topic
function custom_asgarosforum_filter_get_posts_order($order) { $order = 'p1.id DESC'; return $order; } add_filter('asgarosforum_filter_get_posts_order', 'custom_asgarosforum_filter_get_posts_order');
Show newest topics first in forum
function custom_asgarosforum_filter_get_threads_order($order) { $order = 't.id DESC'; return $order; } add_filter('asgarosforum_filter_get_threads_order', 'custom_asgarosforum_filter_get_threads_order');
Show oldest topics first in forum
function custom_asgarosforum_filter_get_threads_order($order) { $order = 't.id ASC'; return $order; } add_filter('asgarosforum_filter_get_threads_order', 'custom_asgarosforum_filter_get_threads_order');
Sort topics in forums by name
function custom_asgarosforum_filter_get_threads_order($order) { $order = 't.name ASC'; return $order; } add_filter('asgarosforum_filter_get_threads_order', 'custom_asgarosforum_filter_get_threads_order');
Quote from hillbillybonez on January 24, 2017, 9:50 pmQuote from Andreas on January 24, 2017, 1:03 pmThanks, that´s very helpful. Regards, Andreas
Agreed, Was wondering about this!
Quote from Andreas on January 24, 2017, 1:03 pmThanks, that´s very helpful. Regards, Andreas
Agreed, Was wondering about this!
Quote from pysteelandt on July 31, 2017, 5:59 pmI don’t understand in which page I must copy the code… I haven’t functions.php file in the extension files… thanks
I don’t understand in which page I must copy the code… I haven’t functions.php file in the extension files… thanks
Quote from Yworld on August 1, 2017, 9:04 amQuote from pysteelandt on July 31, 2017, 5:59 pmI don’t understand in which page I must copy the code… I haven’t functions.php file in the extension files… thanks
In your current design theme
Quote from pysteelandt on July 31, 2017, 5:59 pmI don’t understand in which page I must copy the code… I haven’t functions.php file in the extension files… thanks
In your current design theme
Quote from notechup on September 7, 2018, 1:10 pmHi Again!
Thanks for all your support and taking the time to respond to people here:)
Question on the ordering of Topics under a Category the Main Forum:
Is there a filter to order all topics inside the Category by latest Posts?
I have a category with 20 topics and I always want the topic with the newest post on top.
Thanks.
Hi Again!
Thanks for all your support and taking the time to respond to people here:)
Question on the ordering of Topics under a Category the Main Forum:
Is there a filter to order all topics inside the Category by latest Posts?
I have a category with 20 topics and I always want the topic with the newest post on top.
Thanks.
Quote from notechup on September 7, 2018, 1:22 pmHi,
I get this error (on my local installation) when I add the code to functions.php and try to create a new topic.
Any idea? The tickbox for subscribe is NOT ticked when I try to create a new topic. I am also admin user, and I have the newest version of the plugin.
( ! ) Fatal error: Uncaught ArgumentCountError: Too few arguments to function AsgarosForumNotifications::subscribe_topic(), 0 passed in /srv/www/example.com/current/web/app/themes/generatepress_child/functions.php on line 64 and exactly 1 expected in /srv/www/example.com/current/web/app/plugins/asgaros-forum/includes/forum-notifications.php on line 115 ( ! ) ArgumentCountError: Too few arguments to function AsgarosForumNotifications::subscribe_topic(), 0 passed in /srv/www/example.com/current/web/app/themes/generatepress_child/functions.php on line 64 and exactly 1 expected in /srv/www/example.com/current/web/app/plugins/asgaros-forum/includes/forum-notifications.php on line 115
Hi,
I get this error (on my local installation) when I add the code to functions.php and try to create a new topic.
Any idea? The tickbox for subscribe is NOT ticked when I try to create a new topic. I am also admin user, and I have the newest version of the plugin.
( ! ) Fatal error: Uncaught ArgumentCountError: Too few arguments to function AsgarosForumNotifications::subscribe_topic(), 0 passed in /srv/www/example.com/current/web/app/themes/generatepress_child/functions.php on line 64 and exactly 1 expected in /srv/www/example.com/current/web/app/plugins/asgaros-forum/includes/forum-notifications.php on line 115 | ||||
---|---|---|---|---|
( ! ) ArgumentCountError: Too few arguments to function AsgarosForumNotifications::subscribe_topic(), 0 passed in /srv/www/example.com/current/web/app/themes/generatepress_child/functions.php on line 64 and exactly 1 expected in /srv/www/example.com/current/web/app/plugins/asgaros-forum/includes/forum-notifications.php on line 115 |
Quote from Asgaros on September 7, 2018, 1:52 pmHello @notechup
Topics are automatically ordered by the time of latest-post as long as you dont overwrite the default-behavior via hooks/filters.
Regarding the php-error: Please check the functions.php file of your theme. It seams that you dont pass one of the necessary arguments in line 64.
Hello @notechup
Topics are automatically ordered by the time of latest-post as long as you dont overwrite the default-behavior via hooks/filters.
Regarding the php-error: Please check the functions.php file of your theme. It seams that you dont pass one of the necessary arguments in line 64.
Quote from tomtom on February 26, 2019, 5:34 pmI want my order of categories changed but i am a complete n00b at this forum. Not real good at editing the functions file. I added the code but nothing has changed. I really need any help you can give me. Thanks so much in advance
// Elementor Compatibility requires PHP 5.4 for namespaces.
if ( version_compare( PHP_VERSION, ‘5.4’, ‘>=’ ) ) {
require_once ASTRA_THEME_DIR . ‘inc/compatibility/class-astra-elementor.php’;
require_once ASTRA_THEME_DIR . ‘inc/compatibility/class-astra-elementor-pro.php’;
}// Beaver Themer compatibility requires PHP 5.3 for anonymus functions.
if ( version_compare( PHP_VERSION, ‘5.3’, ‘>=’ ) ) {
require_once ASTRA_THEME_DIR . ‘inc/compatibility/class-astra-beaver-themer.php’;
}/**
* Load deprecated functions
*/
require_once ASTRA_THEME_DIR . ‘inc/core/deprecated/deprecated-filters.php’;
require_once ASTRA_THEME_DIR . ‘inc/core/deprecated/deprecated-hooks.php’;
require_once ASTRA_THEME_DIR . ‘inc/core/deprecated/deprecated-functions.php’;
function custom_asgarosforum_filter_get_threads_order($order) {
$order = ‘t.id ASC’;
return $order;
}
add_filter(‘asgarosforum_filter_get_threads_order’, ‘custom_asgarosforum_filter_get_threads_order’);
I want my order of categories changed but i am a complete n00b at this forum. Not real good at editing the functions file. I added the code but nothing has changed. I really need any help you can give me. Thanks so much in advance
// Elementor Compatibility requires PHP 5.4 for namespaces.
if ( version_compare( PHP_VERSION, ‘5.4’, ‘>=’ ) ) {
require_once ASTRA_THEME_DIR . ‘inc/compatibility/class-astra-elementor.php’;
require_once ASTRA_THEME_DIR . ‘inc/compatibility/class-astra-elementor-pro.php’;
}
// Beaver Themer compatibility requires PHP 5.3 for anonymus functions.
if ( version_compare( PHP_VERSION, ‘5.3’, ‘>=’ ) ) {
require_once ASTRA_THEME_DIR . ‘inc/compatibility/class-astra-beaver-themer.php’;
}
/**
* Load deprecated functions
*/
require_once ASTRA_THEME_DIR . ‘inc/core/deprecated/deprecated-filters.php’;
require_once ASTRA_THEME_DIR . ‘inc/core/deprecated/deprecated-hooks.php’;
require_once ASTRA_THEME_DIR . ‘inc/core/deprecated/deprecated-functions.php’;
function custom_asgarosforum_filter_get_threads_order($order) {
$order = ‘t.id ASC’;
return $order;
}
add_filter(‘asgarosforum_filter_get_threads_order’, ‘custom_asgarosforum_filter_get_threads_order’);
Quote from tomtom on February 26, 2019, 5:36 pmhttps://tenahhouserecoveryllc.com/forum/
i want th forums rules firsts, then the section with general questions, then the drug of choice. This forum is for a rehab inpatient facility. Thanks again
https://tenahhouserecoveryllc.com/forum/
i want th forums rules firsts, then the section with general questions, then the drug of choice. This forum is for a rehab inpatient facility. Thanks again