• Resolved encaf1

    (@encaf1)


    I operate a website with several podcasts (http://chsrfm.ca/) for our radio station, each one set up as a category. I have activated the Subscribe Widget for Category Podcasting, but it has not been displayed on the page.

    I noticed that there is a third field indicating which category id to use, but since this widget is used across all categories, it is a nonsensical field in this case.

    I started digging in (being a code monkey, can’t help myself) and discovered that in class.powerpress-subscribe-widget::widget() the variable $instance[‘subscribe_category_id’] was unset. Since this is a category page, I had it check for the query variable instead ( get_query_var(‘cat’) ), which is properly propagated.

    By simply modifying the check for an empty $instance[‘subscribe_category_id’] to use the page variable instead, the plug is now being displayed properly.

    (Caveat: we sometimes have a show which lives in more than one category; that may be a contributing factor, but there is a specific bug that I have discovered.)

    My suggestion is that if “Category Podcasting” is set within the configuration of the widget, it would treat an empty category as a directive to get the category from the page request — just as I have done. Alternatively, a deeper check can be made to see if the page is a category archive and then only display it. In cases where multiple categories cover the same episodes, it will not be confused, because only one category would be listed.

    Now, the adaptation on a per-post basis for subscribing to a category, that is a bigger change that I plan to investigate.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Shawn

    (@shawnogordo)

    I’ve asked the Blubrry dev team to look at your question. An answer will be posted here as soon as possible.

    Plugin Author Angelo Mandato

    (@amandato)

    Hello @encaf1,

    We developed an option in PowerPress called “Strict category podcasting”. Do you have this enabled? To enable, go to Category podcasting, at the bottom of the page there is an option to enable Strict category podcasting.

    While you are at it, i suggest also enabling “Podcast Only Feeds” for categories, this would gove you a podcast only feed for a category with slug “food”, e.g. example.com/category/food/feed/podcast/

    We developed Strict category podcasting to solve the problem you are trying to solve now. When you create a podcast episode, you pick exactly one category for that podcast to be associated with. Once you do this, no matter what view the page is found (home page, search, etc..) it will use that category for the player and links, including these subscribe links. Otherwise, only pages that are identified as a category identified page will display the correct subscribe links. If you do not use the “strict category podcasting” option, then you will find that there is an uphill battle trying to solve this problem. For example, WordPress allows you to associate multiple categories to a post, at that point the logic would require you to decide which category to use.

    Please take a look at the Strict Category option and then reply and let me know if that will work out for you.

    Thanks,
    Angelo

    Thread Starter encaf1

    (@encaf1)

    I tried using “strict category podcasting”, but it made no difference, so I started looking a bit closer at the code. We also have shows that have the potential for multiple categories, although I did some tests on posts that were in only one category, and that also had no effect.

    It’s actually an unnecessary solution for this context. This is a category archive page — it only has one category anyway, and limits the posts displayed to those of the category (although does not require it to be exclusively that category).

    So, the plugin can easily identify that a) this is a category page, b) category podcasting is turned on for this category, and c) I know which category it is. Therefore: display the plugin.

    Strict category podcasting doesn’t really do anything here.

    “Podcast only feeds” are also not a solution, because a show should be free to add additional information and other posts in the feed without them being neglected by the viewer. After all, this is about a *subscription* plugin, which means they may not yet have subscribed, or they want further information. Why would I segregate the extra posts from the podcast posts, when I want them to subscribe?

    If the posts appear in only one category, the information posts will not appear in the same place in the website as the podcast posts, which again defeats the purpose.

    Also, since categories can be nested, I see no reason to restrict podcast episodes to a single category. If they are not restricted, you can offer a “super-category” of podcasts, or of a particular type like “spoken word” or “baseball”. It’s much more flexible, and doesn’t actually add any further difficulty to use (so far as I’ve been able to see), although it conflicts directly with your “strict category podcasting” notion.

    Now, where the Strict Category etc stuff does come into use is when displaying a list of posts that are from different podcasts. However, since you already have the notion of a “Primary Category” in WordPress, why would you not use that here too? In any case, Strict Category and Podcast-only Categories have no effect on the problem I’m trying to solve: to put a subscription button on a category page.

    Plugin Author Angelo Mandato

    (@amandato)

    Hello @encaf1,

    All great points, I only meant to explain the strict mode option, that way you could understand the challenges we have been trying to solve since we started offering category podcasting. It is messy.

    With that said, I do have a though that maybe we could allow for the category option for the sidebar widget could be set to a special variable. For example %CATID%:123 in the category ID field would indicate to PowerPress to use the current page category ID for the widget or 123 if no category found. If the page is a home page or a search result page we would display the category ID following the %CATID%:123, category ID = 123. The challenge is that sidebar widget has to display something as the webpage would have already created elements to wrap around the widget. We could use just an asterisk + colon + category ID (*:123), it would mean the same thing, match the current category and if there is no category use this cat ID 123.

    I just looked at WordPress, I do not see this “primary category” feature you mentioned, can you elaborate?

    Thanks,
    Angelo

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Subscribe widget not recognizing Category Podcasting’ is closed to new replies.