WordPress – registering sidebar and adding a button directly after .textwidget

Well as long as the buttons are all the same: if (function_exists(‘register_sidebar’)) { register_sidebar(array( ‘name’=> ‘Parallax Area’, ‘id’ => ‘parallax’, ‘before_widget’ => ‘<li class=”parallax-box”>’, ‘after_widget’ => ‘<button class=”btn-action”>Learn More…</button></li>’, ‘before_title’ => ‘<h2>’, ‘after_title’ => ‘</h2>’, )); } If the buttons were not all the same, you could make them be the same and specify the … Read more

Automatically delete posts based on query

Here is what I ended up with: Basically, I had the logic of the timing at the bottom wrong. Figuring out times and dates and what note is hard… add_action(‘init’, ‘delete_unclaimed_apps’); function delete_unclaimed_apps() { $availapps = get_posts(array( ‘post_type’ => ‘appointment’, ‘post_status’ => ‘publish’, ‘meta_query’ => array ( array( ‘key’ => ‘app_status’, ‘value’ => ‘available’, ), … Read more

How to add a piece of code in function

if( in_array( ‘comments’,$meta_info ) ){ $key=”link”; echo ‘<span class=”post-meta-info with-cmt”>’ . apply_filters(‘yt_icon_comment’, ‘<i class=”fa fa-comments”></i>’) . ‘ ‘; comments_popup_link( __( ‘0 Comments’, ‘theme’ ), __( ‘1 Comment’, ‘theme’ ), __( ‘% Comments’, ‘theme’ )); echo ‘</span>’; echo ‘&nbsp;<a href=”‘. get_post_meta($post->ID, $key, true) .'” target=”_blank”>Images Source</a>’ . “\n”; } Try this code once. I modified the … Read more

Show the post date using the wp_get_archives() function?

wp_get_archives() can not display post date, but you can force wp_get_archives to display date by using hook. Put the following function at the end of your custom template file or functions.php file – function wpse_the_title($title, $id){ if( $date = get_the_date(‘d/m/Y’, $id) ){ $title = sprintf(‘%s – %s’, $date, $title); } return $title; } Replace with … Read more

Create input select image URL?

By Javascript you can pop-up the media and on select you can update the image URL to the textbox. Below is the code. var custom_uploader; jQuery(‘<Should-be-a-button-selector>’).click(function(e) { e.preventDefault(); //If the uploader object has already been created, reopen the dialog if (custom_uploader) { custom_uploader.open(); return; } //Extend the wp.media object custom_uploader = wp.media.frames.file_frame = wp.media({ title: … Read more