Overriding or hooking into td_config.php, adding value to Filter > Sort array

Posted in: Newsmag
Post count: 43

I’m adding a custom sorting option to the block/big grid code.

To add it to the drop down list in the editor, the option value needs to be added to the sort array in this section of td_config.php around line 11275. This file will not override in child theme so is there a way to use a hook in functions.php to just add this value?

static function get_map_filter_array ($group = ‘Filter’) {
array(
“param_name” => “sort”,
“type” => “dropdown”,
“value” => array (
‘- Latest -‘ => ”,
‘Oldest posts’ => ‘oldest_posts’,
‘Alphabetical A -> Z’ => ‘alphabetical_order’,
‘Popular (all time)’ => ‘popular’,
‘Popular (jetpack + stats module requiered) Does not work with other settings/pagination’ => ‘jetpack_popular_2’,
‘Popular (last 7 days) – theme counter (enable from panel)’ => ‘popular7’,
‘Featured’ => ‘featured’,
‘Highest rated (reviews)’ => ‘review_high’,
‘Random Posts’ => ‘random_posts’,
‘Random posts Today’ => ‘random_today’ ,
‘Random posts from last 7 Day’ => ‘random_7_day’ ,
‘On This Day’ => ‘on_this_day’,
‘Most Commented’ => ‘comment_count’
),

Thanks.

Post count: 23312

Hello WalnutHillDesign,

Please check our documentation regarding on child theme support here -> https://forum.tagdiv.com/the-child-theme-support-tutorial/, and there you will find which type of files are overwritten in the child theme and which not. As you can see, the td_config.php is not overwritten in the child theme and unfortunately, it does not exist any other way in this regard, sorry!

Thanks for your understanding!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newsmag’ is closed to new topics and replies.