latest post at top of list
Quote from Asgaros on December 6, 2018, 11:27 amHello @peter208a
Please check out the following topic. The first code-example should be the one you are looking for.
Hello @peter208a
Please check out the following topic. The first code-example should be the one you are looking for.
Quote from peter208a on December 6, 2018, 11:32 amI don’t know how to do that
I will get my computer literate friend to do that
Thank you
I don’t know how to do that
I will get my computer literate friend to do that
Thank you
Quote from peter208a on December 6, 2018, 11:43 amI just tried that myself as I found the right file but I added it at the very bottom but when I clicked on the update button it wouldn’t update the file
I just tried that myself as I found the right file but I added it at the very bottom but when I clicked on the update button it wouldn’t update the file
Quote from Asgaros on December 6, 2018, 11:48 amIf you cant update the files via the WordPress-editor, you need to adjust the file-permissions via a FTP-application:
https://codex.wordpress.org/Changing_File_Permissions
Alternatively you can upload the updated file manually via your FTP-application.
If you not sure how to do it please let your friend do it because otherwise there is the risk that your website is not accessible anymore.
If you cant update the files via the WordPress-editor, you need to adjust the file-permissions via a FTP-application:
https://codex.wordpress.org/Changing_File_Permissions
Alternatively you can upload the updated file manually via your FTP-application.
If you not sure how to do it please let your friend do it because otherwise there is the risk that your website is not accessible anymore.
Quote from peter208a on December 7, 2018, 11:27 amfunctions.php gives a path to wp-admin/theme-editor.php
functions.php appears to be in the wp-content folder
So I am confused
I copied both files so that I can get back to the original if necessary
I tried putting the following code in both files – neither alters the order of posts putting the newest post 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’);
functions.php gives a path to wp-admin/theme-editor.php
functions.php appears to be in the wp-content folder
So I am confused
I copied both files so that I can get back to the original if necessary
I tried putting the following code in both files – neither alters the order of posts putting the newest post 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’);
Quote from Asgaros on December 7, 2018, 11:40 am@peter208a
You need to put the code in theĀ functions.php file of the theme which you are using on your site (/wp-content/themes/your-theme/functions.php).
The code has to be at the end of the file, but before the closing ?> (when ?> doesnt exist, it doesnt matter).
You need to put the code in theĀ functions.php file of the theme which you are using on your site (/wp-content/themes/your-theme/functions.php).
The code has to be at the end of the file, but before the closing ?> (when ?> doesnt exist, it doesnt matter).
Quote from peter208a on December 7, 2018, 11:51 amOK – understood
That is what I have tried – I will try again
I notice the following is before the instructions in the file – do I need to put this before your code
/**
See below the line of hyphens the last few lines of code in the present file
———————————————————————————————————
/**
* Additional features to allow styling of the templates.
*/
require get_parent_theme_file_path( ‘/inc/template-functions.php’ );/**
* Customizer additions.
*/
require get_parent_theme_file_path( ‘/inc/customizer.php’ );/**
* SVG icons functions and filters.
*/
require get_parent_theme_file_path( ‘/inc/icon-functions.php’ );
OK – understood
That is what I have tried – I will try again
I notice the following is before the instructions in the file – do I need to put this before your code
/**
See below the line of hyphens the last few lines of code in the present file
———————————————————————————————————
/**
* Additional features to allow styling of the templates.
*/
require get_parent_theme_file_path( ‘/inc/template-functions.php’ );
/**
* Customizer additions.
*/
require get_parent_theme_file_path( ‘/inc/customizer.php’ );
/**
* SVG icons functions and filters.
*/
require get_parent_theme_file_path( ‘/inc/icon-functions.php’ );
Quote from peter208a on December 7, 2018, 5:26 pmI added the code and it makes no difference – it doesn’t work
This is how the end code now looks – I have placed it for you to view under the line below
/**
* Additional features to allow styling of the templates.
*/
require get_parent_theme_file_path( ‘/inc/template-functions.php’ );/**
* Customizer additions.
*/
require get_parent_theme_file_path( ‘/inc/customizer.php’ );/**
* SVG icons functions and filters.
*/
require get_parent_theme_file_path( ‘/inc/icon-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 added the code and it makes no difference – it doesn’t work
This is how the end code now looks – I have placed it for you to view under the line below
/**
* Additional features to allow styling of the templates.
*/
require get_parent_theme_file_path( ‘/inc/template-functions.php’ );
/**
* Customizer additions.
*/
require get_parent_theme_file_path( ‘/inc/customizer.php’ );
/**
* SVG icons functions and filters.
*/
require get_parent_theme_file_path( ‘/inc/icon-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 Asgaros on December 9, 2018, 7:55 pmHello @peter208a
The code looks fine, but you used the code for topic-ordering and not the one for post-ordering in your example. Please replace it with the correct one, ensure that caching is disabled for your forum-page and it should work fine.
Hello @peter208a
The code looks fine, but you used the code for topic-ordering and not the one for post-ordering in your example. Please replace it with the correct one, ensure that caching is disabled for your forum-page and it should work fine.