Build a new block module with using td-api-plugin

Posted in: Newspaper
Post count: 9

I need a help. using 9 version I have custom content I try to build a new block module with using td-api-plugin.
Please have a look the link
http://suman.gr/devne/suman/
its showing block but its out side of the block at the top left of the page. It might show bottom.. what parameter missing.. need to call any other function.. This might be huge help for me.
Best regards
Simos

Here is my custom code under module >> td_module_77.php

<?php

$exclude = array();

/* OPED */
$oped_tag_post_args = array(
‘no_found_rows’ => true,
‘numberposts’ => -1,
‘post_type’ => ‘post’,
‘post_status’ => ‘publish’,
‘order’ => ‘DESC’,
‘orderby’ => ‘date’,
‘ignore_sticky_posts’ => false,
‘tag_slug__in’ => ‘oped’
);

$oped_tag_posts = get_posts($oped_tag_post_args);
foreach ($oped_tag_posts as $post) { $exclude[] = $post->ID; }

?>

<div class=”row” style = “padding:0 10px;” id =””>
<?php $limit = 6; if ($oped_tag_posts) : foreach (array_slice($oped_tag_posts, 0, $limit) as $post) : setup_postdata($post); ?>
<div class=”col-sm-2 col-md-2″ style = “max-width:200px;min-width:180px;margin:0 auto;min-height: 400px;”>
<?php
$post->box_class = ‘medium’;
$post->show_author_thumb = true;
get_template_part(‘partials/post-item7’, ‘box’);
?>
</div>
<?php endforeach; array_splice($oped_tag_posts, 0, $limit); endif; ?>

</div>

<?php

class td_module_77 extends td_module {

function __construct($post) {
//run the parrent constructor
parent::__construct($post);
}

function render() {
ob_start();

?>

<?php return ob_get_clean();
}
}

Post count: 9

Any one can help me please ..very much appreciate

Post count: 20688

Hi,

So you are referring to the block in the top of the page. It should work if you follow the documentation for adding a new block and a new module
https://forum.tagdiv.com/api-blocks-introduction/
https://forum.tagdiv.com/api-modules-introduction/

You can also experiment with the new flex blocks, these are highly customizable blocks that can be made to look in many ways. For example all of these are made with flex block 1
https://demo.tagdiv.com/newspaper/flex-block/
It is also easier to do if you use flex blocks.

Thanks

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