Access last visit time to a post
You can put a small script in your single.php that updates a custom field with the current time. update_post_meta(get_the_ID(),”last_visit”,time());
You can put a small script in your single.php that updates a custom field with the current time. update_post_meta(get_the_ID(),”last_visit”,time());
try this <div class=”container”> <div class=”inner_box”> <ul> <?php while ( have_posts() ) : the_post(); ?> <li> <?php the_title(); ?> <?php the_content(); //this is not in inner_box ?> </li> <?php endwhile; ?> </ul> </div> </div> try this <div class=”container”> <ul> <?php while ( have_posts() ) : the_post(); ?> <li> <div class=”inner_box”> <?php the_title(); ?> <?php the_content(); … Read more
Before answer I want to say that your code is not really wrong but can be improved: why run 2 queries when you can run only one? caller_get_posts is deprecated, use ignore_sticky_posts, instead get_terms has not title_li nor show_count argument. Moreover $taxonomy is the first argument and do nothing in the $args array (second argument). … Read more
Posts (note the plural) template does not exists. The archive of standard post type, when is not a more specific template (date archive, author archive, taxonomy archive) is handled by: home.php (and if this file doesn’t exist) by index.php. If you intend Post (note the singular) the right template file is single.php Once understood this, … Read more
For the header First of all you have to know how retrieve the current page, that is done by get_query_var(‘page’) Knowing it, writing what you want is easy. It can be a little hard if you want to link the previous page correctly. In this case you have to use an internal function of wordpress, … Read more
Perhaps these plugins will help you: Mandatory fields This plugin is responsible for making certain fields mandatory before publishing any post in wordpress. Force Post Title This is simple plugin which forces the users to write POST title in Add New Post page. They both seem to prevent the posting only via JavaScript validation in … Read more
WordPress generates a large number of RSS feeds. For a single post the URL for that feed is the single post URL plus /feed/ or ?feed=rss2 if pretty permalinks are off. If you try that you will see the comments feed, though, and not the post itself. To get the post itself add ?withoutcomment=1 or … Read more
This is because save_post hook function accepts post id as parameter and not post object so the save_custom_meta function should be as following. /** Save the Data **/ function save_custom_meta($post_id) { // verify nonce if (!wp_verify_nonce($_POST[‘shortdesc_meta_box_nonce’], basename(__FILE__))) return $post_id; // check autosave if (defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE) return $post_id; // check permissions if (!current_user_can(‘edit_post’, $post_id)) return … Read more
I’ve installed your plugin and it doesn’t work. Feeds counter are updated correctly, but no feed are shown (and so no ‘Press this’ buttons). After that when I install it I see several notices: are you testing your plugin with wp debugging active? The best way, for me, is redirect users to the standard wordpress … Read more
Have you seen the update_user_meta() WordPress function?