Page 1 of 1

super easy question for php person, simple format problem

Posted: Mon Jun 28, 2010 7:36 pm
by mgason
I know nothing about PHP.
this code is supposed to create a countdown timer when used in a theme in wordpress. I need to use it in a php widget. The widget does not accept the short code PHP of [].
It needs a proper <?php ?> format.
I can not seem to guess what that is, hope someone can help

The following is from the plugin page.....

If you want to insert individual countdown timers, such as in posts or on pages, you can use the following shortcode:

[fergcorp_cdt_single date="ENTER_DATE_HERE"]

Where "ENTER_DATE_HERE" uses PHP's strtotime function and will parse about any English textual datetime description.

this code does work to return a list of timers when placed in the php sidebar widget.

Code: Select all

<li id='countdown'><h2>Countdown:</h2>
<ul>
<?php function_exists('fergcorp_countdownTimer')?fergcorp_countdownTimer():NULL; ?>
</ul>
</li>

Re: super easy question for php person, simple format proble

Posted: Tue Jun 29, 2010 1:58 am
by greyhoundcode
Can you provide a few more details? What widget are we talking about - is it available on Extend?

Re: super easy question for php person, simple format proble

Posted: Tue Jun 29, 2010 6:41 am
by internet-solution
mgason wrote:I know nothing about PHP. ...
Then how do you know it is a super easy question for a php person? :mrgreen:

Re: super easy question for php person, simple format proble

Posted: Tue Jun 29, 2010 7:47 am
by greyhoundcode
Plugin instructions (as posted by mgason) wrote:If you want to insert individual countdown timers, such as in posts or on pages, you can use the following shortcode:

[fergcorp_cdt_single date="ENTER_DATE_HERE"]
It sounds as if the intention (as is normally the case) is to use the shortcode from within pages and posts, rather than within widgets.

If I write a widget that accepts user parameters then I don't necessarily parse those parameters for shortcode, so yeah you might need a bit of PHP know how to resolve this.

It's not necessarily difficult but without seeing the code and some more detailed information it is difficult to answer.