• for example.. the client im working for is wondering if it is possible to make an advert show within the single post page from the 3rd day onwards.

    wordpress version 2.1.3

    Is this possible?

    thanks for your time!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Yes, it’s possible.

    In your single.php’s Loop, you’ll want to do something like this:

    $threeDaysAgo = time() - (3 * 24 * 60 * 60);
    if (get_the_time('U') < $threeDaysAgo) {
    // put your ad code output here
    }

    Also, upgrade to at least WordPress 2.2.3. Older versions (like 2.1.3) have security flaws.

    Thread Starter jamiecarter7

    (@jamiecarter7)

    I love you otto42!

    Thread Starter jamiecarter7

    (@jamiecarter7)

    hmm.. im having trouble on how to get this to work..

    Im not very knowledgeable with php in the slightest..

    can you give me any help in installing it?

    Thanks for the time again. greatly appreciated

    When mentioned you needed the code for the “single post page” so you will want to put that in your theme’s single.php file.

    If you are using the WordPress 1.6 Default theme, you’d put that code in wp-content/themes/default/single.php.

    Other Resources:
    Templates
    Template Hierarchy
    Stepping into Templates
    Stepping into Template Tags
    Editing_Files

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Code For Showing Something within a post 3 days after its published’ is closed to new replies.