Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Reply To: [Waiting for user confirmation] Date Filters from Date of Post Displayed?

$
0
0

Hi Caridad, thanks for your patience and guidance, don't think I have been clear enough in my responses. I believe my issue is with trying to use shortcodes within shortcodes.

Basically, what I want to do is create a filter where the custom field "biz-join-date" falls in between the attributes of startdate="[startdate]" and postdate="[postdate]". The challenge I am having (I believe) is the use of these shortcodes. I understand that using "shortcodes within shortcodes" I am restricted to custom fields as outlined on this page: "http://wp-types.com/documentation/user-guides/shortcodes-within-shortcodes/" however, from looking at your response it seems that I can create a custom shortcode to be used [date2] – but it is not working.

I created my [startdate] shortcode using this which outputs the correct "start date" (excuse typos I am not copying and pasting):

add_shortcode('startdate', 'startdate_shortcode');
function startdate_shortcode() {
$date = get_the_date('U');
if ($date == ''){
}else{
$date = strtotime("-30 days",$date);}
return $date;}

I basically used the same code to get my postdate shortcode. The problem I am having seems to be that the shortcodes do not properly insert the values… which makes sense from the above link and what it says. However in your original response it seems that perhaps there is a way to insert a custom shortcode… ?

Perhaps I am going about this the entirely wrong way and there is a much better way altogether. But in essence I want to filter post that have a date between the parent post date minus 30 days.

Thanks again for your patience and help.


Viewing all articles
Browse latest Browse all 20145

Trending Articles