John Allsopp
Forum Replies Created
-
AuthorPosts
-
I know Stiofan is currently reworking all the plugin templates, so it may be best to wait until that’s been done. You should then be able to hook things in to the positions you want them.
Hi @eqhes,
That’s exactly what i’m suggesting you do – it’s just that the style.css you create in your child theme will not override styles in the plugin unless you force it to load after the plugin’s css files, or use css-specificity as i explained above, to give greater weight to style your elements.Thanks @guust for the link.
A note on CSS specificity, to keep things simple think of it as a number, and the biggest number wins…
Inline styles = 1,x,x,x (1000 for each inline style:something;)
IDs “#” = x,1,x,x (100 for each ID)
Classes “.” = x,x,1,x (10 for each class)
Elements “p etc” = x,x,x,1 (1 for each element)
“!important” can be thought to beat them all with 1,x,x,x,x (10,000)eg: #geodir_wrapper ul li .geodir_new_listing = a score of 112
100 for the ID (#geodir_wrapper)
10 for the class (.geodir_new_listing)
2 for the elements (ul & li)To override that style you would need to get more specific. One way to do this is add a class to the body “.myclass”,
eg: .myclass #geodir_wrapper ul li .geodir_new_listing = a score of 122
100 for the ID (#geodir_wrapper)
20 for the classes (.myclass and .geodir_new_listing)
2 for the elements (ul & li)Hope that helps rather than confuses!
You could change the css to show your image – firebug shows me that the “new” image is declared in /geodirectory-assets/css/style.css on line 300, so you can just overwrite this in your child-theme’s stylesheet:
#geodir_wrapper ul li .geodir_new_listing { background: url("../images/my-new-new.png") no-repeat scroll left top rgba(0, 0, 0, 0);
I don’t have featured on my test site, but it would be the same principal.
May 17, 2014 at 11:01 pm in reply to: GeoDirectory with Parallax themes + mobile apps + special listings #2415I’m not qualified to answer most of your questions, but you can use the custom-posts addon to accomplish numer 2 in your list – you can set up another post type called community, and choose what fields you want.
This reply has been marked as private.Great stuff – it would be good if the plugin could move in this direction…and yes, i would be willing to work on a Genesis GD child theme 🙂
Let’s say your plugin has a function that generates the page title (geodir_do_post_title), another for the content (geodir_do_post_content), another for the sidebar, comments etc etc and your templates are just used to output that content…
Then a genesis template could be made to simply output those to the correct areas for genesis – and any changes you make to functionality will never affect the integration of genesis, because the output templates will never have to change.<?php // Simple Genesis Template // Remove Genesis output remove_action( 'genesis_entry_header', 'genesis_do_post_title' ); remove_action( 'genesis_entry_content', 'genesis_do_post_content' ); remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); //* more as required // Add Geodir content instead add_action( 'genesis_entry_header', 'geodir_do_post_title' ); add_action( 'genesis_entry_content', 'geodir_do_post_content' ); add_action( 'genesis_entry_footer', 'geodir_post_meta' ); //* more as required genesis();
I know that’s only a simple example, and i don’t know how radically you would have to change the plugin to make that possible….?
Cool, keep up the good work 🙂
Hi Stiofan,
No nothing’s broken for me. It was just a suggestion that it might be a nice point of reference to help people building themes.I think for maximum plugin uptake and own your own sanity here on the forums, separating display from function is crucial. I would love to see template files that look like:
some_filterable/pluggable_action( call wp head )
some_filterable/pluggable_action( open geo wrapper )
some_filterable/pluggable_action( spit out content )
some_filterable/pluggable_action( close geo wrapper )
some_filterable/pluggable_action( call wp footer )I know that’s over-simplistic, but you get the point 🙂
If you want to use Genesis at the moment, i would choose a theme where the navigation is inside the header (using the header-right area).
If your theme has anything “hooked” into position (extra sidebars, before content etc) or moved using a remove_action/add_action then these elements won’t work on any WPGeo theme pages.The issue is that the templates of the plugin output everything in one area, and they don’t call genesis();
This means that you can’t use various functions that are genesis-specific such as navigation and other widget areas.Whether or not you can start now is a good question! I suppose you will be a little limited for styling until you know exactly how the integration will work – are they writing a plugin (like Genesis Connect For Woocommerce) or are they intending to ship a child theme with it’s own set of templates that work within the Genesis system?
Are they going to leave everything within the geo wrapper, or split it up and hook the sidebar into the Genesis sidebar?I am using another theme for the time being, just to get used to the plugin and putting all my style mods into a separate stylesheet. When the Genesis integration comes, i can decide whether to switch back to Genesis and my mods should be easy to transport.
Awesome job @Vikas sir!
Another way to skin the cat would be to find how your theme enqueues the styles and change that.
Normally i work with Genesis, so if i wanted to override the nasty Woocommerce css for example, i could get Genesis to load it’s styles later, then i don’t need to add another stylesheet.remove_action( 'genesis_meta', 'genesis_load_stylesheet' ); add_action( 'wp_enqueue_scripts', 'genesis_enqueue_main_stylesheet', 15 );
Unfortunately WPGeo doesn’t play nice with Genesis, so this doesn’t really apply – just thought i’d throw it out there.
-
AuthorPosts