Tagged: categories, metadata
-
AuthorPosts
-
July 19, 2018 at 1:32 pm #987383
Hi!
I’ve been trying to move all the meta information to the bottom of my single post, I notice that if I use the “Elegant” blog post theme, the author and date are at the bottom, but the categories remain at the top, is there a way I can have the categories at the bottom along with the rest of the information?
Thank you in advance!
July 19, 2018 at 8:08 pm #987609Hey Joy,
Open up single.php and search for following code:
<div class='post_data'> <span class='categories'><?php the_category(', ') ?><?php edit_post_link('Edit', ', ', ''); ?></span> <span class='author'><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span> </div><!--end post data-->
delete it and insert it before following line:
</div><!--end entry-->
Best regards,
Jordan ShannonJuly 20, 2018 at 11:10 pm #988075Hi Shannon,
Thank you so much for your help! Actually, I am not sure if I am looking in the wrong file, but the single.php that I have for the 4.4 version of Enfold – right in the root – does not contain any of the code you mention.
Here is what I see on that file below, am I looking in the wrong place? The Theme update part mentions that I do have the latest version :/
<?php if ( !defined('ABSPATH') ){ die(); } global $avia_config; /* * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory. */ get_header(); $title = __('Blog - Latest News', 'avia_framework'); //default blog title $t_link = home_url('/'); $t_sub = ""; if(avia_get_option('frontpage') && $new = avia_get_option('blogpage')) { $title = get_the_title($new); //if the blog is attached to a page use this title $t_link = get_permalink($new); $t_sub = avia_post_meta($new, 'subtitle'); } if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title(array('heading'=>'strong', 'title' => $title, 'link' => $t_link, 'subtitle' => $t_sub)); do_action( 'ava_after_main_title' ); ?> <div class='container_wrap container_wrap_first main_color <?php avia_layout_class( 'main' ); ?>'> <div class='container template-blog template-single-blog '> <main class='content units <?php avia_layout_class( 'content' ); ?> <?php echo avia_blog_class_string(); ?>' <?php avia_markup_helper(array('context' => 'content','post_type'=>'post'));?>> <?php /* Run the loop to output the posts. * If you want to overload this in a child theme then include a file * called loop-index.php and that will be used instead. * */ get_template_part( 'includes/loop', 'index' ); $blog_disabled = ( avia_get_option('disable_blog') == 'disable_blog' ) ? true : false; if(!$blog_disabled) { //show related posts based on tags if there are any get_template_part( 'includes/related-posts'); //wordpress function that loads the comments template "comments.php" comments_template(); } ?> <!--end content--> </main> <?php $avia_config['currently_viewing'] = "blog"; //get the sidebar get_sidebar(); ?> </div><!--end container--> </div><!-- close default .container_wrap element --> <?php get_footer(); ?>
July 20, 2018 at 11:15 pm #988076Hi,
If possible, please provide admin info in the private area so we can log in and look into the issue further.
Best regards,
Jordan ShannonJuly 20, 2018 at 11:27 pm #988078Thank you so much for looking into it, i just added the information in the private section =]
- This reply was modified 6 years, 4 months ago by howjoyful.
July 22, 2018 at 10:06 am #988297Hi howjoyful,
The place to look for the code is in includes/loop-index.php.
If you need further assistance please let us know.
Best regards,
VictoriaJuly 22, 2018 at 10:58 am #988313Hi Victoria,
Thank you for looking into it, I just looked in includes/loop-index.php and I could not find the code there either, is it in a different file?
Thank you for your help!July 22, 2018 at 1:12 pm #988351Hi howjoyful,
Can you please post the credentials again?
Best regards,
VictoriaJuly 24, 2018 at 4:42 am #989017Thank you for checking this Victoria, here I am adding the credentials again.
July 24, 2018 at 7:56 pm #989326Hi howjoyful,
Can you please have the Appearance > Editor enabled?
Here is how to do it
Best regards,
VictoriaJuly 26, 2018 at 4:47 am #990029I just did that Victoria, thank you for looking!
July 26, 2018 at 2:00 pm #990251Hi howjoyful,
Thank you.
Best regards,
VictoriaJuly 26, 2018 at 10:58 pm #990488Thank you, Victoria! This would be the includes/loop-index.php file, right?
July 28, 2018 at 10:41 pm #990982August 1, 2018 at 6:46 am #992178Thank you so much for your help.
I tried the fix but when I implement it, my post titles disappeared, I played with the code Victoria changed and I managed to erase the tags from the top and not to have the titles disappear, BUT I can’t make the tags show at the bottom of the post.
I tried Victoria’s fix, but it either shows the categories at the bottom and erases the titles or (like I have them now) shows the title and no categories.
Is there a way to have the categories show at the bottom?This is the code that it’s not working:
//added by vic $cat_output = ""; if(!empty($cats)) { $cat_output .= '<span class="blog-categories minor-meta">'; $cat_output .= $cats; $cat_output .= '</span>'; $cats = ""; } // The wrapper div prevents the Safari reader from displaying the content twice ¯\_(ツ)_/¯ echo '<div class="av-heading-wrapper">'; echo strpos($blog_global_style, 'modern-blog') === false ? $cat_output.$title : $title.$cat_output; echo '</div>'; //
August 1, 2018 at 1:42 pm #992397Hi,
If you would like to try a different approach, I tested this javascript on my localhost with the blog set to “Elegant” in the theme options. As long as you have the “blog-author” showing in your meta, which I see you do, this will move the categories below the date & author and leave the title at the top.
It will work for archive pages and single pages.
Try adding this code to the end of your functions.php file in Appearance > Editor:function move_categories(){ ?> <script> jQuery(window).load(function(){ jQuery( '.single .post-entry,.archive .post-entry' ).each(function() { jQuery( this ).find( '.blog-categories' ).insertAfter( jQuery(this).find('.blog-author') ); }); }); </script> <?php } add_action('wp_footer', 'move_categories');
that is after you restore the other file so the categories shows at the default top location.
Best regards,
MikeAugust 1, 2018 at 7:04 pm #992522Thank you SO MUCH, Mike!
That worked like a charm! I restored the file added the function and the categories are exactly where I needed them to be! Thank you so much again =]
August 2, 2018 at 2:45 am #992641Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads under Enfold sub forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Moving the categories to the end of the post?’ is closed to new replies.