How to create an optionally available stylesheet for visually impared users?

Easy to setup a button trigger/toggle with a bit of jQuery. Here’s a working example I made for you: https://jsfiddle.net/8Le2tjvr/1/ The Code: HTML: <button id=”impaired-button”>Impaired Button</button> jQuery $(‘#impaired-button’).click(function() { $(‘body’).toggleClass(‘impaired’); }); CSS .impaired h1 { font-size: 50px; } Just add .impaired before any css that you want specifically styled for impaired users. This will be … Read more

WordPress archive page showing 404 Error [duplicate]

You should mention register function in your Question. Add flush_rewrite_rules( false ); in Your custom_post_type register function. it is necessary when you are creating custom post with archive. example code: function create_my_post_type(){ register_post_type(‘MyPost’, array( ‘labels’ => array(‘name’ =>__(‘My-custom-Post’),’singular_name’ => __(‘my-post’)), ‘rewrite’ => array(‘slug’ => ‘MyPost’,’with_front’ => true), ‘public’=>true, ‘has_archive’ => true, )); flush_rewrite_rules(false); //recreate rewrite … Read more

Get post format and use it as a CSS class in different spans

Every post has a maximum of one format and one status. To echo the format you need: if (get_post_format($post->ID)) echo ‘<span class=”format-‘ . get_post_format($post->ID); . ‘”></span>’; To echo the status you need this: if (get_post_status($post->ID)) echo ‘<span class=”status-‘ . get_post_status($post->ID); . ‘”></span>’; Hopefully this is what you need.

Can I add generic numbering HTML classes to items as a loop runs?

You could use post_class within the loop. <?php post_class( ‘myclass-here’); ?> This will add the necessary HTML class=”” and WP defaults classes plus your new myclass-here class You could then use counters within the loop to add a unique suffix to your post class // Outside the loop initialize your counter $counter = 1; . … Read more

Not all CSS elements transferring via parent to child?

good question! Basically, in your enqueue you call the Parent stylesheet first then the child, so any child styles (by definition of css specificity) will override the parent styles. Code example from the WordPress codex: https://codex.wordpress.org/Child_Themes <?php function my_theme_enqueue_styles() { $parent_style=”parent-style”; // This is ‘twentyfifteen-style’ for the Twenty Fifteen theme. wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ … Read more

Using transient for dynamic css , how to name it?

Unless you do something weird with your settings, transients will just make your code harder to read without adding any measurable performance value. People that want performance should use object caching and page caching and your current code is probably already the best there is to utilize them. Transients will add almost nothing for them. … Read more