Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I try to add some content on the post excerpt in wordpress. For a category page excerpt condition working perfect. but i am not sure how to check in home page i tried is_home and is_front_page like that

    function addtoexcerpt($excerpt) {
    ob_start();

    $values = ob_get_clean();
    return $values.$excerpt;

    }
if(is_single()||is_category()||is_front_page()) {
    add_filter('the_excerpt','addtoexcerpt');
}

But for homepage itself is not come's up, i a homepage there is 3more columns with these one of the column as blog post how to check the homepage blogpost in order to append the content

I am using expound theme template.

Thanks vicky

share|improve this question

2 Answers 2

In the case of expound theme index page is used as homepage, and there is no static front-page in the theme.

Try to add is_home() to the condition.

function addtoexcerpt($excerpt) {
    ob_start();
    $values = ob_get_clean();
    return $values.$excerpt;
}
if( is_single()||is_category()||is_home() ) {
    add_filter('the_excerpt','addtoexcerpt');
}

I hope this should help you.

share|improve this answer

It depends on how you set your home page in Settings > Reading. Try is_home().

When you test to see if a page is the home page in WordPress, it depends on how you set your home page in Settings > Reading. If you set your homepage as "Your latest post" or when you choose "A static page" and the home page is set to the page in which you want to display the post, use is_front_page() to test for your home page. However, if you choose "Your latest posts", you should use is_home() to test for your home page. Also, your theme might be using a custom page template for the home page so another option is to test for page id or hardcode it into the page template. –

share|improve this answer
    
Please add an explanation to your answer: why could that solve the problem? –  toscho Dec 26 '13 at 3:14
    
Please edit your answer, comments are temporary and not covered by our search engine. –  toscho Dec 26 '13 at 3:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.