Get post_id in module

Posted in: Newspaper
Post count: 37

Hi, I wont past in front page icon for news. Icons like photo, video etc – https://i.imgur.com/3NvUYEG.png
I wont add icon for tags, but Plugins for thisevery old and not work.

I decide do this by ACF plugin.
In file wp-content/themes/Newspaper/includes/modules/td_module_8.php i past:


<?php the_field('news-icons',$post_id); ?>

How I can get post_id? I try $this->get_post_id() and $this->post_id() – not work.

Maybe you recomended another way for thise task. Thanks.

Post count: 20688

Hi,

Something like this will get the post ID – https://www.screencast.com/t/2zPMvHSO0N
I believe that is what you are looking for, give it a try.

Thanks

Post count: 37

Thanks, work.

Help me please last quest:


<div class="item-details">
<?php echo $this->get_title($title_length);?>

<?php the_field('news-icons', $this->post->ID); ?>

<div class="td-module-meta-info">
<?php if (td_util::get_option('tds_category_module_8') == 'yes') { echo $this->get_category(); }?>
<?php echo $this->get_author();?>
<?php echo $this->get_date();?>
<?php echo $this->get_comments();?>

</div>
</div>

$this->get_title($title_length) – from Call thise function? I need custimise – <h3 class=”entry-title td-module-title”>….

  • This reply was modified 8 years by Filandor.
  • This reply was modified 8 years by Filandor.
Post count: 37

found – Newspaper/includes/wp_booster/td_module.php


...
function get_title($cut_at = '') {...
...

thanks.

Say me please – when you add posibility insert share button as shortcode? It is very bed, when in post I past tagdiv share button but in product, or custom post – other button

Post count: 20688

Only posts can be shared at the moment, I cannot say if there will be modifications in the matter anytime soon, I am not aware of them.
You could use an additional sharing plugin maybe, or disable theme sharing on posts and use a plugin for the whole website.

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