Custom Post type with ACF in REST API, how do I get those values?

I really hope that you have managed this issue. In case you don’t, this kinda works for me since there is a way to register a custom acf endpoint, in the functions.php file you have to add the next code: //Custom acf endpoint; function my_endpoint( $request_data ) { // setup query argument $args = array( … 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

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

What to do when theme and WordPress coding standards conflict?

This is a very subjective question — though a very good and interesting one, and I’ll try to provide my personal view on this. In general, you should always try to adhere to the WordPress Coding Standards. The only exception to this is when you’re changing existing code. Basically, when you’re editing an existing “product” … Read more