Adding ACF to News Ticker

Posted in: Newsmag
Post count: 108

Hi guys

Is it possible to add ACF to news ticker? At the moment, by deafult there is only Title – if it has only few words then it looks funny .. with all the left blankspace …

Since all our posts have ACF i was thinking of adding some info to Title ..

Possible?

Thank you

Post count: 6535

Hi

You can try to edit td_module_trending_now.php and call there some custom fields: http://screencast.com/t/eYAfx9y0pAV For more details please check this link: https://www.advancedcustomfields.com/resources/code-examples/

Thanks!

Post count: 108

Yes i tried that in first plan, but it is not working

<?php
/**
* Created by PhpStorm.
* User: tagdiv
* Date: 03.02.2015
* Time: 10:05
*/

class td_module_trending_now extends td_module {

function __construct($post) {
parent::__construct($post);
}

function render($order_no) {
ob_start();
?>

<div class="<?php echo $this->get_module_classes(array("td-trending-now-post-$order_no", "td-trending-now-post")); ?>">

<?php echo $this->get_title();?><?php echo get_post_meta($post->ID, 'prizorisce', true); ?>

</div>

<?php return ob_get_clean();
}
}

I’m using the same code in loop-single.php and it works

<?php echo get_post_meta($post->ID, 'prizorisce', true); ?>

Post count: 6535

Hi

You have to use the code like here: http://screencast.com/t/XHuVjj3my0

<?php echo get_post_meta($this->post->ID, 'custom-field-name', true); ?>

In above example I’ve added post_views_count field in trending now block. Note that you will need this css to make the custom filed content visible: http://screencast.com/t/ynfAnosf

.td-trending-now-display-area .entry-title {
display: inline-block!important;
} 

Thanks!

Post count: 108

Sorry for late reply .. just to say it is working like a charm 😉

Post count: 108

huh .. looks like I have additional question 🙂

If you take a look at our News tredning at http://www.cele.si you can see that link font is smaller then other text (ACF)

Can i make them equal?

Thank you

Post count: 6535

Hi

You can increase the font size for news-ticker from theme panel > theme fonts: http://screencast.com/t/EBBQzXvlEj
Thanks!

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