WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to determine the page if a front page? (5 posts)

  1. flamey
    Member
    Posted 7 years ago #

    I want to write a plugin to insert something in my posts, but _only on the front/home page_.

    i was going to add filter like this:
    add_filter('the_content', 'my_function');

    but i don't know how to determine within my_function() weather the page is a home page or not.

    any help would be appreciated! tia

  2. Chris_K
    Member
    Posted 7 years ago #

    is_home()

    See Conditional_Tags for more.

  3. drmike
    Member
    Posted 7 years ago #

    IIRC the function call is if_home()

  4. flamey
    Member
    Posted 7 years ago #

    thank you guys! im going to try it right now

  5. flamey
    Member
    Posted 7 years ago #

    yep, works. thanks again :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags