WordPress Ignoring My Custom Post Type Templates?

Got it. I had tried to use flush_rewrite_rules() on plugin activation/deactivation, as so: function creativeworks_activate() { // register taxonomies/post types here flush_rewrite_rules(); } function creativeworks_deactivate() { flush_rewrite_rules(); } register_activation_hook( __FILE__, ‘creativeworks_activate’ ); register_deactivation_hook( __FILE__, ‘creativeworks_deactivate’ ); …but that didn’t seem to do anything. However, when I changed the site-wide permalink options arbitrarily and saved them, … Read more

wp_enqueue_style will not let me enforce screen only

I found the answer. Roots has a roots_clean_style_tag that limits everything except print as a media type. I updated mine slightly to just allow screen as well: function roots_clean_style_tag($input) { preg_match_all(“!<link rel=”stylesheet”\s?(id='[^’]+’)?\s+href=”https://wordpress.stackexchange.com/questions/95293/(.*)” type=”text/css” media=”https://wordpress.stackexchange.com/questions/95293/(.*)” />!”, $input, $matches); // Only display media if it’s print if($matches[3][0] === ‘print’){ $media=” media=”print””; } elseif ($matches[3][0] === ‘screen’){ $media=” … Read more

Sage WordPress – Plugin Namespace: Not Found

You must specify in the roots sage theme composer.json the runtime where autoload can find the classes. “autoload”: { “psr-4”: { “App\\”: “app/”, “App\\Blocks\\”: “app/Blocks/”, “Itineris\\AcfGutenblocks\\”: “../../plugins/acf-gutenblocks/src/”, } } Don’t forget to run composer dump-autoload

get_stylesheet_uri returns wrong path

I don’t think you want get_stylesheet_uri, which will return the complete stylesheet URL including style.css. You want get_stylesheet_directory_uri, which will give you the path up to the child/parent theme stylesheet directory but not the trailing style.css, and which is the function used by the Roots theme per the code you posted. wp_enqueue_style(‘fsc’, get_stylesheet_directory_uri().’/abcdefg.css’, false, null); … Read more

Getting Permalink within the loop

As suggested, went to the function reference and from there to the Source File (located in wp_includes/link-template.php) in which there are four functions that each return similar results. <?php echo get_post_permalink() ?> http://newdep.localhost/instruments/jester/ <?php echo post_permalink() ?> http://newdep.localhost/instruments/jester/ <?php the_permalink() ?> /instruments/jester/ <?php echo get_the_permalink() ?> http://newdep.localhost/instruments/jester/ In this case, since this is a custom … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)