WordPress.org

Ready to get started?Download WordPress

Forums

Feature A Page Widget
[resolved] Modify HTML output for Page Title (4 posts)

  1. katart17
    Member
    Posted 1 year ago #

    I've been trying to use a Filter to add a 'span' tag within the Page Title 'h1' tag. I figured out how to modify $page_title but I can't figure out how to modify the $page_title_html output.

    Please help. Thanks

    http://wordpress.org/extend/plugins/feature-a-page-widget/

  2. mrwweb
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Katart17,

    What exactly are you hoping to do with the <span>? Frequently <span>s are for styles that can be achieved other ways with just CSS.

    There's no easy way to modify the $page_title HTML, so if you really have to do that, you'll need to follow the instructions on the FAQ page for using the fpw_default.php file to override the output and then just customizing the title output on lines 51 and 65, using the $page_title value.

  3. katart17
    Member
    Posted 1 year ago #

    I am working with Font Awesome to add an Icon Font to the H1 tag. I need to add an "i" tag within the H1 to get this to work. I ended up using the fpw_default.php override to get this to work, but I would've rather used a hook within the functions.php file.

    Thanks for the great plugin.

  4. mrwweb
    Member
    Plugin Author

    Posted 1 year ago #

    Glad you were able to make it work! If you have a moment to review the plugin or vote on future features, I always appreciate the extra feedback.

    I'm not that familiar with Font Awesome, but you might consider a pseudo-element solution next time that uses pure CSS:

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.