Post ID in custom module

Posted in: Newspaper
Post count: 2

Hi, I have a small Problem :-/ I search to retrieve the post ID in my custom module plugin.I have try many code, but I doesn’t find…

In example: $this->post_ID or $this->ID….

An idea?

function render() {
ob_start();
?>
<div class="td_module_6 td_module_wrap td-animation-stack">
<?php echo $this->get_image('td_100x70');?>

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

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

</div>

</div>

<?php return ob_get_clean();
}
}

Post count: 22421

Hi,

Maybe this will help:
https://developer.wordpress.org/reference/functions/get_the_id/
https://developer.wordpress.org/reference/functions/get_post/
Unfortunately modules were not created to get the post id. There is no post sorting on modules but rather on blocks: http://screencast.com/t/xC5bTVqw5d
If you require specific post id’s on your module this will have to be made custom and we have no recommendations in this regard. We suggest hiring a freelancer to help out as we cannot provide any custom work at the moment. Sorry.

Thanks.

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