Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1462588

    ​H​ello,

    ​We are using the Magazine element and want to place the “title” above the “categories.” Currently, the categories appear (in gray) above the title (in black). (They are stacked with the categories appearing first.) We would prefer a solution using CSS.

    You can see the magazine element on the homepage of the new website at: https://arlingtonhist.wpenginepowered.com/.

    The magazine element appears immediately under the title: “Latest News and Stories”.

    Please advise.

    Thank you for your help with this!

    #1462593

    mayby a mod knows a method to influence the generation of that sequence – perhaps via filter: avf_magazine_header_content

    but here is a quick jQuery function for child-theme functions.php:

    function change_position() { 
    ?>
    <script>
    (function($){
      $('.entry-content-header').each(function() {
        movedElement = $(this).find('.av-magazine-title');
        targetElelemt = $(this).find('.av-magazine-cats-wrap');
          $(movedElement).insertBefore($(targetElelemt));
      });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'change_position');
    #1462596

    i think there must be a way to reorder an existiing array .
    inside magazine.php there is on lines 1545ff :

    $header_content = array(
    	'time'		=> "<time class='av-magazine-time updated' {$markupTime}>{$time}</time>",
    	'author'	=> $author,
    	'cats'		=> $cats,
    	'tags'		=> $tags,
    	'title'		=> "<{$titleTag} class='av-magazine-title entry-title {$titleCss}' {$markupTitle}>{$title}</{$titleTag}>"
    );

    And that is the reason why the cats are placed over the titles.
    Edit : code erased see snippet from Ismael

    but: as mentioned above – maybe there is a very easy way to reorder that array.

    #1462640

    Hi,

    Thank you for the inquiry.

    As suggested above, try to use this avf_magazine_header_content filter in the functions.php file:

    function avf_reorder_magazine_header_content($header_content, $entry) {
        $header_content = array(
            'time'   => $header_content['time'],
            'author' => $header_content['author'],
            'title'  => $header_content['title'],
            'cats'   => $header_content['cats'],
            'tags'   => $header_content['tags'],
        );
    
        return $header_content;
    }
    
    add_filter('avf_magazine_header_content', 'avf_reorder_magazine_header_content', 10, 2);
    

    Best regards,
    Ismael

    #1462681

    brilliant – I didn’t think of this little trick to use it again as $header_content[‘cats’].
    So – definitely use this snippet. I see you know how to get rid of the word “in”.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.