Archived topic
Change post title according to the color background of image
3 replies · Started by Kelvin on June 2, 2019
Dear Sir/Madam,
I know how to use the Element, I like using the Header type of element, I will use the featured image of the page/post as the default background image to the Element but also preset the fallback image.
If I use a light colour image as a background, then I set the page title in dark, otherwise dark colour background image with white colour. I can create two elements and preset the fallback image with light and dark and then assign the rules with specific page/post but it is too time-consuming if I frequently write the blog. Does GP have smarter solution that I can simply select from page/post attribute or custom field and then GP will use the correct element?
Best regards,
Kelvin.
Hi there,
the easiest way to do this would be to use the Post Category display rule, then simply select the required category for each post.
To add categories to Pages for this purpose you can add this PHP Snippet:
function add_categories_to_pages() {
register_taxonomy_for_object_type( 'category', 'page' );
}
add_action( 'init', 'add_categories_to_pages' );
Dear David,
Thanks for your excellent support. I am sure I was right in purchasing GP.
Best regards,
Kelvin.
You're very welcome. Glad you're enjoying GP