-
AuthorPosts
-
September 30, 2015 at 5:38 pm #511714
Hi,
in order to adapt the Polylang plugin (like mentionned here) how could I replace loop-index.php code
$excluded_taxonomies = apply_filters('avf_exclude_taxonomies', array('post_tag','post_format'), get_post_type($the_id), $the_id);
by
$excluded_taxonomies = array_merge( get_taxonomies( array( 'public' => false ) ), array('post_tag','post_format') ); $excluded_taxonomies = apply_filters('avf_exclude_taxonomies', $excluded_taxonomies, get_post_type($the_id), $the_id);
in my child theme? In order to keep native files intact.
September 30, 2015 at 5:52 pm #511725Hi Anton!
In your child theme create a folder called “includes” and copy the loop-index.php file into it. It will be used instead of the parent theme.
Best regards,
ElliottSeptember 30, 2015 at 5:58 pm #511732Elliott thank you,
just one more question : if in next Enfold update loop-index.php will be modified, since I copied the entire file – does it mean my child theme won’t take into consideration the updated modifications?
September 30, 2015 at 6:00 pm #511738Hi!
Yes, that’s correct.
You may want to consider using the filter instead, https://kriesi.at/support/topic/taxonomies/#post-124956.
Best regards,
Elliott- This reply was modified 9 years, 2 months ago by Elliott.
September 30, 2015 at 6:21 pm #511756And how can I know what’s the name ot the taxonomy I need to exclude?
Sinci Polylang author gave this code to resolve the problem:$excluded_taxonomies = array_merge( get_taxonomies( array( 'public' => false ) ), array('post_tag','post_format') ); $excluded_taxonomies = apply_filters('avf_exclude_taxonomies', $excluded_taxonomies, get_post_type($the_id), $the_id);
October 1, 2015 at 1:49 am #511898Hi!
Try with this code:
add_filter('avf_exclude_taxonomies', function($excluded_taxonomies) { return array_merge( get_taxonomies( array( 'public' => false ) ), array('post_tag','post_format') ); });
Cheers!
JosueOctober 3, 2015 at 7:23 pm #513179hey @Josue
thank you very much, perfect help as usual!
May I ask you another question for the same loop-index.php?
How could I change the order in class=”post-meta-infos”? I’d like this order: Date, Author, Taxonomies, Comments
I’ve tried to add to functions.php (child theme) the next code, but that didn’t work:echo "<span class='post-meta-infos'>"; $markup = avia_markup_helper(array('context' => 'entry_time','echo'=>false)); echo "<time class='date-container minor-meta updated' $markup>".get_the_time(get_option('date_format'))."</time>"; echo "<span class='text-sep text-sep-date'>/</span>"; echo '<span class="blog-author minor-meta">'.__('by','avia_framework')." "; echo '<span class="entry-author-link" '.avia_markup_helper(array('context' => 'author_name','echo'=>false)).'>'; echo '<span class="vcard author"><span class="fn">'; the_author_posts_link(); echo '</span></span>'; echo '</span>'; echo '</span>'; $taxonomies = get_object_taxonomies(get_post_type($the_id)); $cats = ''; $excluded_taxonomies = apply_filters('avf_exclude_taxonomies', array('post_tag','post_format'), get_post_type($the_id), $the_id); if(!empty($taxonomies)) { foreach($taxonomies as $taxonomy) { if(!in_array($taxonomy, $excluded_taxonomies)) { $cats .= get_the_term_list($the_id, $taxonomy, '', ', ','').' '; } } } if(!empty($cats)) { echo '<span class="blog-categories minor-meta">'.__('in','avia_framework')." "; echo $cats; echo '</span><span class="text-sep text-sep-cat">/</span>'; } if ( get_comments_number() != "0" || comments_open() ){ echo "<span class='comment-container minor-meta'>"; comments_popup_link( "0 ".__('Comments','avia_framework'), "1 ".__('Comment' ,'avia_framework'), "% ".__('Comments','avia_framework'),'comments-link', "".__('Comments Disabled','avia_framework')); echo "</span>"; echo "<span class='text-sep text-sep-comment'>/</span>"; } echo '</span>';
October 5, 2015 at 9:04 am #513547Hm no, that won’t work, there doesn’t seem to be a way to do that -via child theme- at the moment. Maybe in the future a filter or a plugabble function could be added.
Regards,
JosueOctober 9, 2015 at 7:16 pm #516638thank you
resolved -
AuthorPosts
- The topic ‘Non public taxonomies 2’ is closed to new replies.