howto: cp/wp - coding how-tos rev 17 jul 2019 ....................................................... how-tos * How to retrieve the slug of current page? A lot of different ways. https://wordpress.stackexchange.com/questions/42117/how-to-retrieve-the-slug-of-current-page $post->post_name; Function to retrieve query object! get_queried_object - below. * Navigation Simple WordPress Snippets to Enhance Your Secondary Navigation https://speckyboy.com/wordpress-snippets-secondary-navigation/ * WordPress Theme Stylesheet Auto-Cachebusting "One method to force browsers to pull the new version is to add/change the ver parameter in the query string (WordPress’ wp_register_script, wp_register_style, wp_enqueue_script, and wp_enqueue_style have a built-in way of doing this)." For twentyseventten can do manually like this: where it has: wp_enqueue_style( 'stylesheet', get_stylesheet_uri() ), MY_THEME_VERSION ); do this: wp_enqueue_style( 'stylesheet', get_stylesheet_uri(), array(), '1' ); stylesheet URL will be like: https://mydomain.com/wp-content/themes/my-theme/style.css?ver=1 more at: https://andrewrminion.com/2018/02/wordpress-theme-stylesheet-auto-cachebusting/ 9 feb 2018 ....................................................... useful functions and tips: * get_queried_object() Retrieves the entire currently-queried object so ... if on a post, will return that post object. if on a page, will return that page object. if on an archive page, will return the post type object. if on a category archive, will return the category object. custom post type single or archive -- will return ... etc. Have to call it after the query, e.g., after the_content(). https://wpshout.com/get_queried_object-how-and-why-to-use-it-with-examples/ Explanation and lots of examples and practical uses. [11 jun 2019] https://codex.wordpress.org/Function_Reference/get_queried_object https://developer.wordpress.org/reference/functions/get_queried_object/ ....................................................... resources: * 120 Cheatsheets https://www.codeinwp.com/blog/wordpress-cheat-sheets-web-development-design/ [updated 11 may 2019 - but some links nowork] _______________________________________________________ begin 19 apr 2019 -- 0 --