Home User profile
tagDiv Member
This user did not write anything. So we are just showing here some random text to make the profile page look nice :)
billspyropoulos
tagDiv Member

Thank you very much. Thats what i needed!

billspyropoulos
tagDiv Member

I came up with a good solution for now. Go to
wp-content/themes/Newspaper/includes/widgets/td_page_builder_widgets.php

and add the following code

class td_block_trending_now_widget extends td_block_widget {
var $td_block_id = 'td_block_trending_now'; // change only the block id, the rest is autogenerated
}

add_action('widgets_init', create_function('', 'return register_widget("td_block_trending_now_widget");'));

this will make a “news ticker” widget and then you can use it via php with the wordpress function


<?php the_widget( 'td_block_trending_now_widget' ); ?>

Althoug its working if you need to customize it (ex. number of post shown) you have to pass a second var on the function which is the array containing the attributes with their values. My next question is
what are these attributes. For example if i want 10 posts from category “World” what should i write?


args = array(
post => 1,
cat => 'World'
);
the_widget( 'td_block_trending_now_widget', $args );

Viewing 2 posts - 1 through 2 (of 2 total)