Coder Social home page Coder Social logo

Comments (4)

philiparthurmoore avatar philiparthurmoore commented on July 17, 2024

You could try something like the following but you may end up seeing subtitles in places that you don't want them to show up:

/**
 * Display subtitles in recent posts widget.
 */
function theme_slug_subtitle_view_supported() {
    return true;
}
add_filter( 'subtitle_view_supported', 'theme_slug_subtitle_view_supported' );

The issue is that the plugin relies on filtering the_title but only within The Loop. What the above code does is just return the post subtitle for every post title that's shown on a page, no matter where it's displayed.

from subtitles.

jdahdah avatar jdahdah commented on July 17, 2024

Thanks for responding so quickly! You're right, it works, but it does appear in places it shouldn't, like in the document <title> tag. I've gone with what is probably the least elegant solution: copied the whole WP_Widget_Recent_Posts class into my theme, registered it as a new widget and modified it to include the subtitle.

from subtitles.

philiparthurmoore avatar philiparthurmoore commented on July 17, 2024

Sounds good. That sounds like a pain, though, but I just don't see any other way around it. I'll update this ticket in the future if I run into any elegant solutions that you may be able to use. Cheers.

from subtitles.

jdahdah avatar jdahdah commented on July 17, 2024

Alright, thanks for your help!

from subtitles.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.