Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #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.

    #511725

    Hi 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,
    Elliott

    #511732

    Elliott 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?

    #511738

    Hi!

    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.
    #511756

    And 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);
    #511898

    Hi!

    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!
    Josue

    #513179

    hey @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>';
    #513547

    Hm 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,
    Josue

    #516638

    thank you
    resolved

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Non public taxonomies 2’ is closed to new replies.