![Check out Enfold](https://kriesi.at/wp-content/themes/kriesi/images/banner-enfold.jpg)
-
AuthorPosts
-
July 21, 2024 at 1:56 am #1462588
Hello,
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!
July 21, 2024 at 7:54 am #1462593mayby 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');
July 21, 2024 at 9:50 am #1462596i 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 Ismaelbut: as mentioned above – maybe there is a very easy way to reorder that array.
July 22, 2024 at 7:50 am #1462640Hi,
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,
IsmaelJuly 22, 2024 at 3:35 pm #1462681brilliant – 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”. -
AuthorPosts
- You must be logged in to reply to this topic.