php - Change text before entry-categories for specific categories on genesis framwork wordpress -
im trying change "filed under:" our service categories , pages (doors, flooring, painting , windows) ids each categories follows 4,5,6,7 , ids each service page follows 28,30,32,34.
i got code studiopress website changes text before entry-categories globally. tried modify below not working.
//* customize post meta function add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) { if ( !is_page() ) { $post_meta = '[post_categories before="filed under: "] [post_tags before="tagged: "]'; return $post_meta; } }
i have 4 pages (the service pages ids above) utilizing blog template , pulling query_args cat=id each category showcase jobs in category.
i have portfolio page (id=13) showcase jobs associated categories above.
then there blog page company updates , news , not showcase jobs (blog page id=19). still want posts on page display "filed under:".
on portfolio , service pages want change "filed under:" "service:". want change remain in effect on actual post of job , on category page (im not utilizing category page if clicks on service type take them there).
i hope more clear...
here code have been playing , attempting still not working. i'm not sure if i'm using is_page correctly of if need using else.
//* customize post meta function add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) { if ( !is_page( array(13,28,30,32,34)) ) { if ( !is_category( array(4,5,6,7) ) ) { $post_meta = '[post_categories before="service: "] [post_tags before="tagged: "]'; } else { $post_meta = '[post_categories before="filed under: "] [post_tags before="tagged: "]'; } return $post_meta; } }
this change following 'service':
- any page in categories 4,5,6,7
- any category page 4,5,6,7
- the portfolio page (id=13)
everything else 'filed under'
add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) { if((is_page() && in_category(array(4,5,6,7))) || (!is_page() && is_category(array(4,5,6,7))) || (is_page() && get_the_id() == 13)) { $post_meta = '[post_categories before="service: "] [post_tags before="tagged: "]'; } else { $post_meta = '[post_categories before="filed under: "] [post_tags before="tagged: "]'; } return $post_meta; }
Comments
Post a Comment