Move Author-Name, Date, View-Count and Comments-Count in mobile theme to bottom!

Posted in: Newspaper
Post count: 361

Dear Tagdiv-Team,

in the mobile-version and the amp-version of the blog there are the breadcrumps followed by the title, the featured image and a line that includes author-name, date, view-count and comments-count. The featured image I have already moved to the bottom of the post and I already want to move the author-name, date, view-count and comments-count to the bottom of the post.

I think thats that code: <div class=”td-module-meta-info”>
<?php echo $td_mod_single->get_author();?>
<?php echo $td_mod_single->get_date(false,false);?>
<?php echo $td_mod_single->get_comments();?>
<?php
if ( ! td_util::is_amp() )
echo $td_mod_single->get_views();
?>
</div>

But when I move it to another position, I get a serious mistake and the mobile page isn’t available. What should I do that it works?

Thank you very much!
Greetings Kathrin

Post count: 35449

Hi,

The most easy way is to set the content where you want to be display -> https://i.imgur.com/nRzXGln.png
In this way there should be no problems.

Thank you!

Post count: 361

I have already tried this and tried it now again but I the critical error persists and the mobile pages can’t be loaded anymore. When I move the metainfo back into the header it works again.

I just want to move the metainfo for views and author and the comments before the featured image, because they cause in the viewpoint a large cumulative layout shift because of the used font-awesome…

<article id=”post-<?php echo $td_mod_single->post->ID;?>” class=”<?php echo join(‘ ‘, get_post_class());?>” <?php echo $td_mod_single->get_item_scope();?>>
<div class=”td-post-header”>

<?php echo $td_mod_single->get_category(); ?>

<header class=”td-post-title”>
<?php echo $td_mod_single->get_title();?>

<?php if (!empty($td_mod_single->td_post_theme_settings[‘td_subtitle’])) { ?>
<p class=”td-post-sub-title”><?php echo $td_mod_single->td_post_theme_settings[‘td_subtitle’];?></p>
<?php } ?>

//metainfo moved to another position
</header>

</div>

<div class=”td-post-content”>
<?php echo $td_mod_single->get_content();?>
<?php

// meta info after post content
<div class=”td-module-meta-info”>
<?php echo $td_mod_single->get_author();?>
<?php echo $td_mod_single->get_date(false,false);?>
<?php echo $td_mod_single->get_comments();?>
<?php
if ( ! td_util::is_amp() )
echo $td_mod_single->get_views();
?>
</div>
// override the default featured image by the templates (single.php and home.php/index.php – blog loop)
if (!empty(td_global::$load_featured_img_from_template)) {
echo $td_mod_single->get_image(td_global::$load_featured_img_from_template);
} else {
if (TD_THEME_NAME === ‘Newsmag’) {
echo $td_mod_single->get_image(‘td_640x0’);
} else {
echo $td_mod_single->get_image(‘td_696x0’);
}
}
?>

<?php echo $td_mod_single->get_social_sharing_top();?>

</div>

If I delete this part of the code: <div class=”td-module-meta-info”>
<?php echo $td_mod_single->get_author();?>
<?php echo $td_mod_single->get_date(false,false);?>
<?php echo $td_mod_single->get_comments();?>
<?php
if ( ! td_util::is_amp() )
echo $td_mod_single->get_views();
?>
</div>

it seems that the lazy loading in the mobile version doesn’t work anymore…

And after trying to move them on the new position the text under the images in the mobile theme isn’t centered anymore…

If I move the meta-info after the featured image it works: but the text isn’t shown inline..

<article id=”post-<?php echo $td_mod_single->post->ID;?>” class=”<?php echo join(‘ ‘, get_post_class());?>” <?php echo $td_mod_single->get_item_scope();?>>
<div class=”td-post-header”>

<?php echo $td_mod_single->get_category(); ?>

<header class=”td-post-title”>
<?php echo $td_mod_single->get_title();?>

<?php if (!empty($td_mod_single->td_post_theme_settings[‘td_subtitle’])) { ?>
<p class=”td-post-sub-title”><?php echo $td_mod_single->td_post_theme_settings[‘td_subtitle’];?></p>
<?php } ?>

</header>

</div>

<div class=”td-post-content”>
<?php echo $td_mod_single->get_content();?>
<?php

// override the default featured image by the templates (single.php and home.php/index.php – blog loop)
if (!empty(td_global::$load_featured_img_from_template)) {
echo $td_mod_single->get_image(td_global::$load_featured_img_from_template);
} else {
if (TD_THEME_NAME === ‘Newsmag’) {
echo $td_mod_single->get_image(‘td_640x0’);
} else {
echo $td_mod_single->get_image(‘td_696x0’);
}
}
?>

<?php echo $td_mod_single->get_social_sharing_top();?>

</div>

<div class=”td-module-meta-info”>
<?php echo $td_mod_single->get_author();?>
<?php echo $td_mod_single->get_date(false,false);?>
<?php echo $td_mod_single->get_comments();?>
<?php
if ( ! td_util::is_amp() )
echo $td_mod_single->get_views();
?>
</div>

<footer>

Greetings Kathrin

Post count: 35449

Hi,

If you moving the info from header like this -> https://i.imgur.com/ajssufA.png -> https://i.imgur.com/gJTwT8c.png the results will be -> https://i.imgur.com/Y1MoEkN.png but moving the content will work better -> https://i.imgur.com/oVRz4uy.png -> https://i.imgur.com/qAvfusg.png -> https://i.imgur.com/scPNctu.png

Thank you!

Post count: 361

Thank you very much! But isn’t that very problematic to have all the content with pictures in the head of the page? For page speed?

Greetings Kathrin

Post count: 35449

Hi Topfgartenwelt,

That is only a html tag, is like a div and more then that the section is not the head and is the header (usually are use for details/navigation) from that section, for the content section from that article, it should not provide any problems.
You can check more about the head and header here -> https://www.w3schools.com/tags/tag_header.asp

Thank you!

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.