• I am using WordPress 3.3.1 and a theme couponpress. I am trying to display current month and year in the posts. Below is the code i am using (added in theme’s functions.php).

    function displaymonth(){
    return date('F');
    }
    add_shortcode('month', 'displaymonth');
    
    function displayyear(){
    return date('Y');
    }
    add_shortcode('year', 'displayyear');

    Then i go to edit post and replace month and year with [month] [year]. Instead of showing the current month and year, it is showing up the code i.e. [month] [year].

    Am i missing something here? Please help.

    Thanks in advance.

  • The topic ‘WordPress Shortcodes not working with couponpress’ is closed to new replies.