Show field if it has contents on Advanced Custom Fields
You can use the ACF API’s get_field to test for the existence of data: if( $lease_rate = get_field(‘lease_rate’) ){ ?> <p><strong>Lease Rate:</strong> <?php echo $lease_rate; ?> </p> <?php }
You can use the ACF API’s get_field to test for the existence of data: if( $lease_rate = get_field(‘lease_rate’) ){ ?> <p><strong>Lease Rate:</strong> <?php echo $lease_rate; ?> </p> <?php }
I would comment if able. If your theme variations consist solely of style modifications you can add the variation stylesheets @ inc/css/ and then here is an example of the references to make it all tick. @ \options\options-core.php: $fields_list[] = array( ‘name’ => __(‘Select a Skin Color’, ‘mytheme’), ‘id’ => ‘mytheme_skin_color’, ‘std’ => ‘default’, ‘type’ … Read more
The correct method is to enqueue the stylesheets, via callback hooked into wp_enqueue_scripts. You can add the contextual conditionals inside the callback: function wpse124258_enqueue_scripts() { if ( ! is_admin() ) { // Conditionally enqueue if ( is_front_page() ) { // Front page stylesheet wp_enqueue_style( ‘front-page-style’, get_template_directory_uri() . ‘/front-page-stylesheet.css’ ); } else if ( is_page() ) … Read more
In you case I’d edited my wp-config.php, and just after if ( !defined(‘ABSPATH’) ) define(‘ABSPATH’, dirname(__FILE__) . “https://wordpress.stackexchange.com/”); I’d added $path = explode( basename( dirname(__FILE__) ), ABSPATH ); define( ‘MYSITEROOTPATH’, $path[0] ); after that, everywhere I need, I’d used // file.php is name of a file in root directory include( MYSITEROOTPATH . ‘file.php’);
Normally WordPress backward compatibility is very strong, (sometimes too much strong IMHO). So it’s close to impossible that a public property (properties declared with var are public at any effects) become private in a future release. However, as you noticed, the variable is marked as private in class doc block, this mean that developers should … Read more
The slider displayed on front page is the one that you define from the customizer option screen. It overrides the one you have assigned to a page that you choose as front page. Hope this helps.
You can get the post thumbnail by using get_the_post_thumbnail(): echo get_the_post_thumbnail( $page->ID, ‘thumbnail’ );
In your example, the company name will not be translated. However, you should at least make it possible to write the name in the native alphabet. Latin letters look really odd in some other alphabets. There is also a legal issue: in some countries it is not allowed to use capital letters for anything but … Read more
If you know a function or class of the plugin’s main file, you can use the Reflection API. Example with my plugin T5 Taxonomy Location add_action( ‘plugins_loaded’, function() { $class=”T5_Taxonomy_Location”; if ( ! class_exists( $class ) ) return; add_action( ‘admin_footer’, function() use ( $class ) { $reflection = new ReflectionClass( $class ); $file = $reflection->getFileName(); … Read more
I figured it out. You have to search your style.css file and find /* Buttons */ Under that you will find the following classes .menu-toggle, article.post-password-required input[type=submit], .bypostauthor cite span {} .menu-toggle, button, {} button[disabled], input[disabled] {} .menu-toggle:active, .menu-toggle.toggled-on, button:active, {} There are 2 states of the button that you need to configure. Hover and … Read more