Closed peq42 closed 1 year ago
Hi @peq42,
Out of the box, WordPress Popular Posts doesn't show video embeds though so I'm not sure what's this "obvious" expected behavior :P
So, how do I reproduce this issue exactly? Are you using some custom code with your popular posts list?
Oh I'm sorry, thought it was supposed to show embed vids and pictures by default.
Any way I could do it tho?
Oh I'm sorry, thought it was supposed to show embed vids and pictures by default.
Where did you get that idea from? The plugin doesn't mention anywhere that it can show videos embeds. It's possible if you're familiar with WordPress & PHP development in general (see How can I use my own HTML markup with WordPress Popular Posts), however it's not a feature that the plugin offers out of the box. You'd need to code that in yourself and/or find someone to assist you with that.
As for pictures, yes, the plugin can show images related to each post, like Featured Images for example (see How does WordPress Popular Posts pick my posts' thumbnails? for more details.)
For your popular posts list to show thumbnails you first need to enable and configure all the related thumbnails settings, like so for example:
Is there any way to display the post as "full" instead of excerpt or summary? I've another plugin that lists the newest posts in a separate page that have all those 3 options and when using "full" it works fine
again sorry, I'm a bit new to this
Is there any way to display the post as "full" instead of excerpt or summary?
Yep, that's doable too. It's not a feature included with the plugin though but -as I suggested before- the plugin provides tools to customize the HTML markup of your popular posts so virtually anything you can think of is possible.
Have a look at the link I shared above to learn more about customizing your popular posts list and if you have any questions please feel free to ask.
I tried looking into the documentation but i'm honestly lost..
I tried adding the following code to functions.php
function wpp_parse_fullhtml_in_popular_posts($html, $post_id) {
if ( false !== strpos($html, '{posthtml}') ) {
$html = str_replace('{posthtml}', $post_html, $html);
}
return $html;
}
add_filter('wpp_parse_custom_content_tags', 'wpp_parse_fullhtml_in_popular_posts', 10, 2);
Then made post HTML Markup into this:
<li class="{current_class}"><div class="wpp-item-data">{title}</div><div class="taxonomies">{taxonomy}</div><div class="wpp-item-data">{posthtml}</div> </li>
but now the post list is just, the title and that's it, its not incorporating the HTML/page content
Hi @peq42,
Sorry for the late reply. I've been busy these days.
About your code, well, it doesn't seem to do anything? The $post_html
variable isn't defined anywhere, but then you're trying to use it with str_replace()
? Is this your complete code?
Can't get videos embed in the post(youtube) and pictures posted in the middle to show on the list
Steps to reproduce it
Expected behavior
Obvious
Environment