• Hi,
    is it possible display the player not only in the full post page but in the short version of the posts, like in a category page?
    https://screencast.com/t/5ygYm8cN
    I tried to edit the php category page and inserted a code like <php do_shortcode(‘[display_podcast]’);> but it didn’t work.

    How can I do?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ntm

    (@ntm)

    podPress inserts the player (or the player preview) in the_content(); and in the_excerpt(); by default with the WP filter hook of the same names.
    You can alter the position of the player by inserting the shortcode into the post content and the excerpt of a post. But the using the shortcode [display_podcast] outside these to section will have no effect. Because podPress looks only the content and the excerpt for this place-holder.
    A different possibility to adjust the position of the player is the option at the General Settings page of podPress.
    What is your ‘Location:’ setting? Start? End? (Try End.)

    Without knowing the source code of the theme of your blog, I can only guess why the shortcode does not get replaced.

    • maybe this post or excerpt is displayed with the help of a custom function or db query (and not with the_content(); or the_excerpt();)
    • maybe the filter action gets removed by a different plugin or theme (Is there a call of remove_filter(); in the files of the theme or an other plugin?)
    • or maybe it is something else which is specific to your theme.

    Regards,
    Tim

    Thread Starter jumust

    (@jumust)

    Hi ntm and thank you very much for your explanation!
    I think you are totally right about the reasons why it happens even though I’m not so good at php.

    Maybe it’s because there is a strange function to get the excerpt I’m not sure, you can see the line 174 in the file of my theme here

    Do you think it’s something I can solve with this theme?
    In the full post page it’s displayed well (I set up the location settings to show at the end)

    Thanks

    Plugin Author ntm

    (@ntm)

    You are right. Line 174 is the critical line. echo strip_tags($post->post_excerpt); takes the excerpt from the $post object directly. That is basically okay. But it bypasses the the_excerpt filter hook and all plugins which are designed to influence the excerpt of a post are unable to fulfill their goal.

    You might try to replace echo strip_tags($post->post_excerpt); with the_excerpt();. Using the_excerpt(); solely would always print an excerpt. If you have not written an excerpt for a post then WP will generate automatically one from the content of the post.
    But you could add a little filter to the functions.php file of your theme: https://pastebin.com/5XgYscVL which filters automatic excerpts but prints manually written excerpts.

    Regards,
    Tim

    Thread Starter jumust

    (@jumust)

    Thanks it works though if I don’t write the excerpt it doesn’t get it automatically, but if I write it I’ll get the audio player without I need to use the [display_podcast]

    For me it’s enough!

    Thank you so much

    Plugin Author ntm

    (@ntm)

    it works though if I don’t write the excerpt it doesn’t get it automatically

    If you are using the filter then that is how it should be.

    You should have always a player whether you right an excerpt or not and regardless of the usage of [display_podcast].
    The filter prevents WP from generating an excerpt (WP generates always automatically an excerpt if you haven’t written one and the template uses the_excerpt.)
    If you like to have an automatically generated excerpt in the same view as in the screenshot then don’t use the filter.

    I’m glad that it works.

    Regards,
    Tim

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: podPress] Display player in short version of posts’ is closed to new replies.