update_usermeta don’t work

You should enable WP_DEBUG mode, so that the white screen of death will give you a more useful error message. The white screen could be caused by a typo, but it looks ok to me. Does your host have simplexml_load_string()? If you don’t have the simple XML library, that could be why returning $setlink works, … 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

Allow the access over wp-login.php

Use the hook template_redirect instead – this will ensure it only runs on the front-end of your site, and not for the admin, login, registration or signup pages. function wpse_159552_maintenance() { if ( ! is_front_page() ) { wp_redirect( home_url() ); exit; } include ‘maintenance/index.html’; exit; } add_action( ‘template_redirect’, ‘wpse_159552_maintenance’ );

Force changing the Site Title and add link

add_filter(‘option_blogname’, ‘filter_name’); function filter_name($string) { return str_replace(‘original’, ‘replacement’, $string); } This code should work, as well as yours. But there’s one catch, you have to use get_bloginfo like this: echo get_bloginfo(‘name’, ‘raw’); If not, bloginfo sanitizes the output, and it eliminates the <a></a>. At the same time is someting good, because if not you would … Read more