Two Functions

Hello,

I wanted to add custom text/html (adsense) to bottom and top on custom posts in certain categories and pages of my wordpress blog . I searched google and found a solution which was not complete, some guy shared a php code and said me to paste it in functions.php which i did and it worked pretty well. But the code is for just one category i need it for different categories.

I want the code to work with more than one category, although i searched google for the solution and tried using different things like adding && and the id of the next category but nothing worked so far.

Here is the code

[php]add_filter(‘the_content’, ‘custom_category_text’);

function custom_category_text($content){
global $post;
$custom_category_text = ‘

This is some text inside a DIV tag
’;
if(in_category(‘3’)){ // change catetegory ID 3
$content = $content . $custom_category_text;
}
return $content;
}
[/php]

Please can someone amend it and provide me with the required one. Thankyou

Sponsor our Newsletter | Privacy Policy | Terms of Service