-
-
Save mklasen/3d0c67774d19d183981fde3405b8f048 to your computer and use it in GitHub Desktop.
<?php | |
add_action( 'wp', function () { | |
if ( get_post_type() === 'person' ) { | |
remove_all_filters( 'the_title' ); | |
} | |
} ); |
Who did you do to obtain the result with only the name of the person without the description between () ?
My bad. It should be hooked on 'wp' instead of 'init'.
It works. I put the code on the functions.php of the wp-includes folder. Thank you.
Awaiting for the update of your plug-in.
Have a safe a nice week-end.
Claude (from France, at home, for few weeks more)
I detected a new bug. As you can see on this page, https://batteriesevent.com/speakers/, when you click on a speaker, the previous and next button don’t follow the order of the speakers. Not the alpha order, not the specific order specified for each person. There is any logic…
Can you help me to fix that?
It works. I put the code on the functions.php of the wp-includes folder. Thank you.
Awaiting for the update of your plug-in.
Have a safe a nice week-end.
Claude (from France, at home, for few weeks more)
Please don't put any code in WordPress core files.
What you could do is add the code as a new plugin, like below:
<?php
/**
* Plugin Name: Remove all filters from the_title
*/
add_action( 'wp', function () {
if ( get_post_type() === 'person' ) {
remove_all_filters( 'the_title' );
}
} );
I detected a new bug. As you can see on this page, https://batteriesevent.com/speakers/, when you click on a speaker, the previous and next button don’t follow the order of the speakers. Not the alpha order, not the specific order specified for each person. There is any logic…
Can you check if this fixes it? :)
<?php
/**
* Plugin Name: Sympose: Sort next/previous post navigation by menu order
*/
function wpse73190_adjacent_post_sort( $orderby, $post ) {
if ( $post->post_type === 'person' ) {
$orderby = "ORDER BY p.menu_order DESC LIMIT 1";
}
return $orderby;
}
add_filter( 'get_previous_post_sort', 'wpse73190_adjacent_post_sort', 10, 2 );
add_filter( 'get_next_post_sort', 'wpse73190_adjacent_post_sort', 10, 2 );
You can create a new file in the wp-content/plugins folder and add the code above. Each code block above is a separate plugin.
You can also give the plugin it's own directory (wp-content/plugins/remove-all-filters/) and add the file inside of the directory.
Can you help me to fix the problem?
As I said by email, I don't know where to put this code because it does not have any effect on the navigation even if I put it on the plug-in files...