How to show postviews instead og commentcount on frontpage?

Posted in: Newspaper
Post count: 87

Hi,

How to show postviews instead og commentcount on frontpage?

Thanks 🙂

Post count: 87
Post count: 22421

Hello,

Please read this topic:
https://forum.tagdiv.com/topic/post_views_count/

Thank you!

Post count: 87

Hi Bogdan,

Thanks for helping,

I would like the pageview to be displayed the same place the comments get displayed now. Where the zero is here: http://www.screencast.com/t/fQA3ES5q

If it’s not possible, I would like to just hide the commentcount, thanks.

Post count: 20688

Hi,

You could disable the comment counts on blocks/modules in the theme panel
https://www.screencast.com/t/bcSfIFQami
Then use the method described in that topic to implement views on the modules you want. Example for module 4 code entered like this
https://www.screencast.com/t/QPCuxNP3i4O
By default the views will be displayed like this
https://www.screencast.com/t/xqgBpyfbdmn
That would not be the proper place for the views, but the theme does not have design for views on modules. You will have to create one, like this example
https://www.screencast.com/t/KtWG47NuHaxQ
This is the code I used in the example

.td_module_wrap .td-post-views{
position:absolute;
display: inline-block;
right: 0;
}

Here is an useful guide to use the browser inspector to create custom code and make various customization to the desired elements
https://forum.tagdiv.com/create-custom-code-using-the-browsers-inspector/

Thanks

Post count: 87

Thanks!

Post count: 87

How to make a space between the eye icon and the number?

Thanks

Post count: 23312

Hi,

Try to use the code below and place it in Theme panel -> Custom CSS area.

header .td-icon-views{
margin-right:20px;
}

Thanks for your understanding!

Post count: 87

Hi C,

For some strange reason the code don’t have any effect, thanks.

Post count: 87

This code creates an extra space with in the blogposts, I want the space on the frontpage, thanks.

Post count: 87

I would like to give both the eye icon and the number the same grey color as the date on the frontpage, thanks.

Post count: 23312

Hello,

Try the code below ->

https://www.screencast.com/t/cTasmJb2ZA6

The result is here -> https://www.screencast.com/t/cTasmJb2ZA6

Thanks.

Post count: 87

Hi,

How do I make this code only to take effect on the frontpage, since it’s also effecting on the posts, so the gap becomes to large in the posts?

What is the selector for the number/count on the posts? Since I have managed to change the color the other places.

Thanks again, much appreciated!

My CSS skills sucks, sorry.

Post count: 87

.news .td-module-meta-info .td-icon-views{
padding-right:5px;
}

Actually worked. 🙂

Post count: 37

looks like folders changed in the latest version. how can this be implemented in the latest version?

Post count: 18283

Hello !

The file is now located in the td-composer plugin. Follow this path: https://www.screencast.com/t/Wml00ClWi4

Thank you !

Post count: 37

Thanks! Where do we now implement the code to display view count? https://www.screencast.com/t/QPCuxNP3i4O

Post count: 18283

Hello !

Here is the TD_MODULE_4 file located now: https://www.screencast.com/t/WorxGwwr

Thank you !

Post count: 37

Looks like adding <?php echo $this->get_views();?> is breaking the whole page

<div class=”td-module-meta-info”>
<?php echo $this->get_author();?>
<?php echo $this->get_date($modified_date);?>
<?php echo $this->get_comments();?>
<?php echo $this->get_views();?> <—- adding this line breaks the whole page
</div>

Post count: 22421

Please do not use the code from that old topic. you need to use the current theme code.
1. Copy the function from td-module-single-base.php: https://www.screencast.com/t/ZrAbh5FAI
2. Paste it in td_module.php: https://www.screencast.com/t/TKIghxjwMc
3. Add the call for the function in your module file: https://www.screencast.com/t/C43vbviUHl
4. Use css to style the element on the front-end: https://www.screencast.com/t/OBSHGQWDd9

Thank you!

Post count: 37

Thank you! worked perfectly.

Last one, how can we edit to add “,” thousand separator for the count.

  • This reply was modified 7 years by arnimation. Reason: one last thing... comma for numbers
Post count: 20688

Hi,


@arnimation
That would be possible, if you make a modification in this file
http://prntscr.com/of6vnr
Some thing like this should work – http://prntscr.com/of6wdnhttp://prntscr.com/of6who if you would like to try it.

Thanks

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