Adding function to child theme’s function.php

You can’t recall the same function or PHP will throw an error. Make your own function and call the same action hook, but give it a priority of 1 which should overrule the parent theme function. function custom_oblique_post_link_to_single() { if ( ! get_theme_mod( ‘read_more’ ) ) :?> <a href=”https://wordpress.stackexchange.com/questions/282703/<?php the_permalink(); ?>”> <div class=”read-more”> <?php echo … Read more

Api external with wordpress

WordPress itself can communicate with external API’s through wp_remote_get and wp_remote_post. See the codex. In your case, you could create a page template called page-search.php (keep in mind that search.php is reserved for the internal WordPress search functionality, so you would define it as a template, and select it when creating the page), and run … Read more

Insert Address fields into function

Insert Address fields into function <?php function getCoordinates($address) { $address = urlencode($address); // set HTTP header $headers = array(‘Content-Type: application/json’); // Open connection $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, ‘http://maps.google.com/maps/api/geocode/json?sensor=false&address=” . $address); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); // Execute request $result = curl_exec($curl); // Close connection curl_close($curl); // get the result and parse to JSON … Read more

dynamic site link for future migration in echo do_shortcode()

You can save your website’s URL into a variable and pass it to the shortcode: $url = site_url(); echo do_shortcode(“[timeline src=”https://wordpress.stackexchange.com/questions/284281/$url/rest-of-the-url/”]”); You should also be able to use your shortcode in the following way: echo do_shortcode(“[timeline src=””.site_url().”/rest-of-the-url/”]”);

Proper Way to Load stylesheet on Condition

You’ll need to put the if statement around the line that enqueues in the first place. // enqueue styles for child theme function wowdental_enqueue_styles() { // enqueue parent styles wp_enqueue_style(‘Divi’, get_template_directory_uri() .’/style.css’, get_the_time() ); // Flip3d css // flip3d only on home page if( is_home() ) { wp_enqueue_style( ‘flip’, get_stylesheet_directory_uri() . ‘/css/flip.css’, get_the_time() ); } … Read more

dynamic name of the style for wp_enqueue_style

this syntax doesn’t seem right to me. First of all what is ABS_URL? If it’s a constant that you’ve defined earlier, then there is an ‘ missing before /includes/box.css’. The code should look like this: $name=”mystyle”; wp_enqueue_style( $name .’-style’, ABS_URL . ‘/includes/box.css’, false ); It works as it should, the output is: <link rel=”stylesheet” id=’mystyle-style-css’ … Read more