Limit content by user registration date

I have just made this code you can try out: add_filter( ‘the_content’, ‘restrict_access’ ); function restrict_access( $content ) { $user_info = wp_get_current_user(); // Get logged in user info $registered = $user_info->user_registered; if( !is_user_logged_in() ) { $content = __( “You are not logged in.”, ‘your_textdomain’ ); } else if (new DateTime( get_the_date() ) < new DateTime( … Read more

Bulk edit post date in wordpress

Original source : post date Create admin-script.js at your current theme ( this use js folder ) jQuery(document).ready(function($){ $(‘.inline-edit-col-right .inline-edit-col’) .append( ‘<label style=”margin-top: 3em;”><span class=”title”>Date</span>’ + ‘<div class=”timestamp-wrap”><select name=”mm”>’ + ‘<option value=”00″>Month</option>’ + ‘<option value=”01″>01-January</option>’ + ‘<option value=”02″>02-February</option>’ + ‘<option value=”03″>03-March</option>’ + ‘<option value=”04″>04-April</option>’ + ‘<option value=”05″>05-May</option>’ + ‘<option value=”06″>06-June</option>’ + ‘<option value=”07″>07-July</option>’ + ‘<option … Read more

XML export posts from one single day

Enhance the native XML export – with a single day selection Here’s one way to modify the native export with a select box, with all available days: Here we assume that there are not “huge” number of days to select from 😉 Otherwise we could use a different kind of user interface. Step #1 First … Read more

Modify Date Format to German

WordPress has a special function for translating dates, called date_i18n. General usage: echo date_i18n( $dateformatstring, $unixtimestamp, $gmt); Supposing you have German as your site’s language this would be: echo date_i18n( ‘j. F Y’, false, false); You can also import the time format from the admin settings, like this: echo date_i18n(get_option(‘date_format’), false, false);

Schedule event every second thursday of the month

WordPress lets you add custom cron schedules, which is normally what you’d want to do in this situation, in conjunction with wp_schedule_event(). But, they work based on intervals rather than specific dates/times. For instance, add_filter( ‘cron_schedules’, ‘addCustomCronIntervals’ ); function addCustomCronIntervals( $schedules ) { $schedules[ self::PREFIX . ‘debug’ ] = array( ‘interval’ => 60 * 2, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)