Conditional Tag Based on Age of Post [duplicate]

<?php $today = date(‘r’); $articledate = get_the_time(‘r’); $difference = round((strtotime($today) – strtotime($articledate))/(24*60*60),0); if ($difference >= 3) { ?> this is a three day old post <?php } ?> the 3 in if ($difference >= 3) { ?> is 3 days old, you can change that to whatever you want. How I could do it, is … Read more

Trying to place shortcode/css/html into an IF conditional statement

Instead of getting all terms, looping over them and then searching your array, you can use the has_termconditinal tag ex: if( has_term( ‘z’, ‘product_cat’,$post->ID ) ) { ?> <div id=”post-timer”> <p class=”timebuy”>Time Left To Buy:</p> <div id=”timer-wrap”> <?php echo do_shortcode( ‘[tminus cid =”12″ omitweeks=”true” days=” ” hours=” ” minutes=” ” seconds=” “/]’ ); ?> </div><!–end … Read more

Conditional Custom Image Header

you could try the following right before you call the body_class() function: <?php $header_image = get_header_image(); if( !empty( $header_image) ){ $custom_body_class=”has-header-image”; } else { $custom_body_class=”no-header-image”; } ?> <body <?php body_class($custom_body_class); ?>>

Cannot retrieve active members only

Curly braces for foreach is missing. Try this: /* Template Name: Directory */ add_action( ‘genesis_entry_content’, ‘ogs_directory’, 5 ); function ogs_directory() { $args = array( ‘blog_id’ => 1, // unless yours is a multisite install, you shouldn’t need to change this ‘exclude’ => array(), // IDs of users that need to be excluded ‘orderby’ => ‘display_name’ … Read more

If less than IE9 [closed]

Here is my ammended version of your code: <?php if( is_ie() && get_browser_version() < 9 ) { if ( is_active_sidebar( ‘countdown-ie’ ) ) { dynamic_sidebar( ‘countdown-ie’ ); } else { ?> <div class=”pre-widget”> <p><strong>Widgetized area 1</strong></p> <p>This panel is active and ready for you to add some widgets via the WP Admin</p> </div> <?php } … Read more

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