Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter McF

    (@mcf)

    Created svg image and applied it instead text.

    Thread Starter McF

    (@mcf)

    Thanks for the answer.
    My wife gave me flowering periods. If they aren’t very precise (starting on June), then I will set first of June as starting period – that’s it. It’s not possible to adjust periods for each year…

    Thread Starter McF

    (@mcf)

    Thanks for the answer.
    I followed your suggestion.
    Added two meta key – one for start, another for the end of flowering period.
    I made them as integer values – days from beginning of the year.

    
    global $post; // declare global post variable
    
    $args = array(
    	'post_type'     => 'post',
    	'post_status'   => 'publish',
    	'orderby'       => 'title',
    	'order'         => 'ASC',
    	'meta_query'    => array(
    		'relation' => 'AND',
    		// Period start
    		array(
    			'key'   => 'Flowering 1 start',
    			'value' => $this->get_year_days(),
    			'type' => 'numeric',
    			'compare' => '<='
    		),
    		// Period end
    		array(
    			'key'   => 'Flowering 2 finish',
    			'value' => $this->get_year_days(),
    			'type' => 'numeric',
    			'compare' => '>='
    		)
    	)
    );
    
    // get the latest blog entry
    return get_posts( $args ); // and more stuff here
    
    • This reply was modified 9 years, 2 months ago by McF.
    Forum: Plugins
    In reply to: Flowers catalog
    Thread Starter McF

    (@mcf)

    Dear Nate,

    Thank You for quick answer.
    I will learn about custom post types, custom taxonomies, and custom fields.
    And later will ask about plugins…

    McF

Viewing 4 replies - 1 through 4 (of 4 total)