Reduce size of responsive title

You can add custom CSS where you use media query in order to reduce the font-size of the title in small devices. You also have some styling that remove the line break and add the 3 dots at the end. So you can also remove them. You can try this code : @media all and … Read more

Add Ajax Hooks and Call from Custom Template PHP

may be here is the error add_action( ‘wp_ajax_my_ajax_action’, ‘my_ajax_action_callback’ ); add_action( ‘wp_ajax_nopriv_my_ajax_action’, ‘my_ajax_action_callback’ ); change to add_action( ‘wp_ajax_my_ajax_action_callback’, ‘my_ajax_action_callback’ ); add_action(‘wp_ajax_nopriv_my_ajax_action_callback’,’my_ajax_action_callback’ ); and in ajax change: action : ‘my_ajax_action_callback go to functions.php and add: require(dirname(__FILE__) . ‘/custom_template.php’); make sure your ajax url is correct!!

Adding string before php [closed]

<?php echo “Posted: “.human_time_diff( get_the_time(‘U’) ) . __(‘ ago’, ‘yourlanguageslug’); ?><br/> It’s not that hard. but, you should these small things.

::before on open/close function [closed]

Your shortcode return text. Wrap return into some HTML, like <div class=”status_text”></div> and style this block. add_shortcode( ‘linestatus’, ‘line_status_handler’ ); function line_status_handler( $atts ) { extract( shortcode_atts( array( ‘open_time’ => ’09:00:00′, ‘closed_time’ => ’17:00:00′, ‘open_text’ => ‘our lines are open’, ‘closed_text’ => ‘our lines are closed’, ), $atts ) ); if ( time() >= strtotime( … Read more

how to make jpg downdable in wordpress?

By default a user can save any image by right clicking on it in their browser and selecting “Save Image…” or similar. HTML5 offers a download attribute to the <a> element that will attempt to force the browser to download the image. So your resulting HTML would look like this: <a href=”https://wordpress.stackexchange.com/questions/293568/{{ url of image … Read more

Count posts on multisite with blog id

In order to use wp_count_posts() as you would on a single site, pass the blog id into the switch_to_blog() function before calling wp_count_posts(). Example: function wpse_get_post_count( $blog_id ){ switch_to_blog( $blog_id ); $post_count = wp_count_posts(); restore_current_blog(); return $post_count; } Ensure restore_current_blog() is used after every switch_to_blog() or you will risk difficulties mentioned in the notes section … Read more