Archived topic
display background color from container with wp_query
5 replies · Started by Mathias on May 14, 2021
Hi there,
Hope anyone can help. I have selected a background color on a container in a custom post and now i would like to display it with a custom query(wp_query)
but when i put
the_content();
Or
generate_do_template_part( 'single' );
It does display the content of the post (also text colors) but doesn't display the background color of the container. i think its because it doesnt load the custom style with wp_query. is there any way to do this ? Any help would be greatly appreciated, thanks a lot !
Hi there,
applying the background color to the post content shouldn't require wp_query - its a simple CSS option.
Can you link me to a post / archive where you want to make this change?
Hi David,
Thanks for the reply. Its on my wamp server so I can't give you a link. I see I didn't explain very well above, ill try to explain best way I can.
This is a custom post-type that I want to display on a template page via wp_query. This wp_query is very handy for styling and it needs to fit isotope sorting. Everything works just fine except I would like to be able to style the blocks in gutenberg with the generatepress/generateblocks system.
So basically my question is : is it possible to get the custom style created with generatepress/generateblocks in the gutenberg panel on my template page with a wp_query?
I've tried to change the CSS print method of generatblocks to inline but that didn't help.
Is it possible to see a page with your custom template ? Might help me understand a little bit better :)
So i resolved my issue with ACF added a color and retrieved it with a shortcode.
My question is still if I can target the stylesheet created in the custom post with wp_query
I am still unclear of whats going on :) Really would help to see the template so we can advise.