need some help with cpt having next-previous links with title or related posts. I'm using Oceanwp theme. For normal posts it show related posts. But for CPT, some code has to be edited.
In the child theme I've copied some files and I can see related posts in cpt but with default categories not with custom taxonomy associated with CPT. This is the code in theme i need help with:
// Term
$term_tax = get_theme_mod( 'ocean_single_post_next_prev_taxonomy', 'post_tag' );
$term_tax = $term_tax ? $term_tax : 'post_tag';
It is in my child theme next-prev-subjects.php and related-posts-subjects.php.
How can I edit this code to use custom taxonomies. I've CPT named Subjects and 3 category like custom taxonomies: Physics, Chem, Maths and one tags like custom taxonomy named tagsubject.
I tried this one but didn't worked
// Term
$term_tax = get_theme_mod( 'ocean_single_post_next_prev_taxonomy', 'subject_category' );
$term_tax = $term_tax ? $term_tax : 'subject_category';
Do I've to use this:
$terms_tax = get_terms( array(
'taxonomy' => 'physics','chem','maths'
'hide_empty' => false,
) );
Any help with this way or any other way will be really appreciated. For other ways I did found similar questions in this forum but I don't know which files to edit or create in the child theme.