My custom markup ignored : Using Custom Markup with the wpp_get_mostpopular();
-
I am trying to create custom markup with the plug in WordPress Popular Posts. If I do this through the admin panel it works fine!
However, I am trying to do it directly in my custom theme template file with the function wpp_get_mostpopular(); in order to add classes etc.
<?php wpp_get_most_popular($popular_posts_args);?> <?php $popular_posts_args = array ( 'header_start' => '<h2 class="widgettitle">', 'header' => 'Popular Episodes', 'header_end' => '</h2>', 'limit' => 5, 'range' => 'all', 'title_length' => 25, 'title_by_words ' => true, 'post_type' => 'post', 'cat' => '4', 'excerpt_length' => 20, 'thumbnail_width' => 100, 'thumbnail_height' => 80, 'wpp-start' => '<ol class="wpp-list">', 'wpp-end' => '</ol>', 'post_html' => ' <li class="clearfix"> <div class="wpp-content"> <div class="wpp-img">{thumb}</div> <div class="wpp-text">{title} <p class="wpp-stats">{stats}</p> </div> </div> ' ); ?>
This yields no changes to the default HTML markup that is generated by the function, but does create the widget and returns results.
I went through the documentation and the plugin, and found a field called ‘custom__html’. I added it to the list of args and set it to true, no changes. Default HTML is generated.
Spent a little more time looking through some more variables in the plugin file, found a couple more, so my $args variable became;
<?php $popular_posts_args = array ( 'header_start' => '<h2 class="widgettitle">', 'header' => 'Popular Episodes', 'header_end' => '</h2>', 'limit' => 5, 'range' => 'all', 'title_length' => 25, 'title_by_words ' => true, 'post_type' => 'post', 'cat' => '4', 'excerpt_length' => 20, 'thumbnail_width' => 100, 'thumbnail_height' => 80, 'custom_html' => true, 'markup' => array( 'wpp-start' => '<ol class="wpp-list">', 'wpp-end' => '</ol>', 'title-start' => '<h2 class="widgettitle">', 'title-end' => '</h2>') , 'post_html' => ' <li class="clearfix"> <div class="wpp-content"> <div class="wpp-img">{thumb}</div> <div class="wpp-text">{title} <p class="wpp-stats">{stats}</p> </div> </div> ' ); wpp_get_mostpopular($popular_posts_args); ?>
And still no joy???
My custom HTML parameters are ignored.
Am i doing something wrong? Perhaps i am calling the wrong fields in order to create custom HTML?
- The topic ‘My custom markup ignored : Using Custom Markup with the wpp_get_mostpopular();’ is closed to new replies.