GravityForm autopopulate dropdown from post

<?php 
add_filter( 'gform_pre_render_1', 'autopopulate_class' );
add_filter( 'gform_pre_validation_1', 'autopopulate_class' );
add_filter( 'gform_pre_submission_filter_1', 'autopopulate_class' );
add_filter( 'gform_admin_pre_render_1', 'autopopulate_class' );
function autopopulate_class( $form ) {
 
    foreach ( $form['fields'] as &$field ) {
 
        if ( $field->type != 'select' || strpos( $field->cssClass, 'populate-events' ) === false ) {
            continue;
        }
 
        // you can add additional parameters here to alter the posts that are retrieved
        // more info: http://codex.wordpress.org/Template_Tags/get_posts
        $posts = get_posts( 'post_type=cpt_type&numberposts=-1&post_status=publish' );
 
        $choices = array();
 
        foreach ( $posts as $post ) {
            $choices[] = array( 'text' => $post->post_title, 'value' => $post->post_title );
        }
 
        // update 'Select a Post' to whatever you'd like the instructive option to be
        $field->placeholder = 'Select a class';
        $field->choices = $choices;
 
    }
 
    return $form;
}

.htaccess redirection

Redirect a single page

Redirect 301 /oldpage.html http://www.yoursite.com/newpage.html
Redirect 301 /oldpage2.html http://www.yoursite.com/folder/

Redirect an entire site

This way does it with links intact. That is www.oldsite.com/some/crazy/link.html will become www.newsite.com/some/crazy/link.html. This is extremely helpful when you are just “moving” a site to a new domain. Place this on the OLD site:

Redirect 301 / http://newsite.com/

Query post with date time range from custom field

<?php 

$sdtime = DateTime::createFromFormat("d F, Y", '1 February, 2018');
$edtime = DateTime::createFromFormat("d F, Y", '30 February, 2018');

$startday = $sdtime->getTimestamp();
$endday = $edtime->getTimestamp();
 
$q = new WP_Query(
    array(
    	'posts_per_page' => $count, 
    	'post_type' => 'fixture-item',
    	'meta_key'       => 'date',
		'orderby'        => 'meta_value',
		'order'          => 'DESC',
		'meta_query' => array(
			array(
				'key'       => 'date',
				'value'     => array( $startday, $endday ),
				'compare' => 'BETWEEN',
			),
		),
    )
); 

?>