WordPress.org

Ready to get started?Download WordPress

Forums

Getting the content on home page (2 posts)

  1. Sudan
    Member
    Posted 1 year ago #

    I wanted to modify the content of the home page by adding few messages to it using my custom plugin. I tried using the the filter add_filter( 'the_content', 'modify_the_content' ); and then checking if the current page is the home page or not using is_home() before adding the message. However, I was not able to change the content.

    The theme is a custom theme that does not display the recent posts but uses the Theme Options page to obtain the content from the user and display it. Interestingly, if i display my posts in the home page, the message will be appended to each of those posts at the end.

    I could modify the theme files itself, but I needed to achieve this using plugin. Any lead or suggestion is welcome.

  2. alchymyth
    Forum Moderator
    Posted 1 year ago #

    checking if the current page is the home page or not using is_home()

    try to use is_front_page()
    http://codex.wordpress.org/Conditional_Tags

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.