• Resolved holysjit

    (@holysjit)


    I only want to show a link when the post is created in 2011 (this year). Is there an if state like:

    [code]
    if year = 2011 then (blalbala)
    [/code]

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Alwyn Botha

    (@123milliseconds)

    if ( get_the_date(‘Y’) == 2011 )

    Thread Starter holysjit

    (@holysjit)

    Awesome. That works, but I want to put
    <?php if (function_exists('wpfp_link')) { wpfp_link(); } ?><?php endif; ?> in it.

    Only posts published in 2011 users can favorite them.

    How?

    Thread Starter holysjit

    (@holysjit)

    FIXED. I used this code:

    <?php if (get_the_date('Y')=="2011"): ?>
     <?php if (in_category('CAT-NAME-HERE')) : ?>
    <?php wpfp_link();?>
      <?php endif; ?>
     <?php endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘If year = 2011’ is closed to new replies.