Stefancom
Forum Replies Created
-
Hi Jim
Thank you very much for your help!
Stefan
Hi
Thanks for your comment! I already guessed it may be impossible.
For those who are interested in this matter as well: Right now I am looking into building a simple events calendar with the Pods plugin. It looks like that could work. And as far as I can tell by now, Pods allows relationships and may be able to do what I was looking for.
Maybe it is the easiest to go just with Font Awesome icons? What do you think?
Hi everyone
I fixed it already!
This page was very helpful. It pretty much did exactly what I was looking for. Go there if you have a similar question like mine. Caimin, thank you for your help, as well.
Stefan
(I apologise for the chaotic messages. In the first one I misunderstood how to post code. In the second I tested how to do it right. In the third I posted my message right.)
Hi Caimin
Thanks for the help! Very much appreciated.
I fail to get this to work, yet weirdly it seems the standard programming provides some sort of “conditional” display of information already:
#_ATT{attribute}{ }When I write it like this, it shows the attribute, if there is one, but stays invisible, if there is not any. … That is already kind of effective, yet surprisingly simple. Not bad.
But I have the impression, that I do need the conditional placeholder after all for what I want to do. But I must have misunderstood something concerning your advice … What seems to be the issue with the following? Would you be able to see the problem?
(1) This is, what I included in my theme’s function.php:
<code>function my_em_has_attribute_event_output_condition($replacement, $condition,</code>$match, $EM_Event){ if( is_object($EM_Event) && preg_match(‘/^is_true/’,$condition, $matches) ){ if( !in_array($args['website'],$EM_Event->event_attributes) &&!empty($EM_Event->event_attributes[‘website’]) ){ $replacement = preg_replace("/\{\/?$condition\}/", '', $match); }else{ $replacement = ''; } } return $replacement; } <code>add_action('em_event_output_condition',</code>'my_em_has_attribute_event_output_condition', 1, 4);(2) This is the definition of this attribute in the Event Settings:
#_ATT{website}(3) This is the code as I use it in the Events’ formatting:
{has_website}Info …{/has_website}So, what I want to do: If there is a website/URL to the event, that can be noted in the newly create “website” attribute field. So, when there is text in that attribute, a link (with the word “Info …” or an image) to that website will be displayed. If there is no text to that attribute, nothing will be displayed, neither the URL nor the word “Info …”. I guess I do need the customised conditional placeholder for that, right?
Best,
Stefan
Test TestHi Caimin
Thanks for the help! Very much appreciated.
I fail to get this to work, yet weirdly it seems the standard programming provides some sort of “conditional” display of information already:
#_ATT{attribute}{ } When I write it like this, it shows the attribute, if there is one, but stays invisible, if there is not any. ... That is already kind of effective, yet surprisingly simple. Not bad. But I have the impression, that I do need the conditional placeholder after all for what I want to do. But I must have misunderstood something concerning your advice ... What seems to be the issue with the following? Would you be able to see the problem? (1) This is, what I included in my theme's function.php: <code>function my_em_has_attribute_event_output_condition($replacement, $condition,</code>$match, $EM_Event){if( is_object($EM_Event) && preg_match(‘/^is_true/’,$condition, $matches) ){
if( !in_array($args['website'],$EM_Event->event_attributes) &&!empty($EM_Event->event_attributes[‘website’]) ){$replacement = preg_replace("/\{\/?$condition\}/", '', $match);}else{
$replacement = '';}
}return $replacement;
} <code>add_action('em_event_output_condition',</code>'my_em_has_attribute_event_output_condition', 1, 4); (2) This is the definition of this attribute in the Event Settings:#_ATT{website}
(3) This is the code as I use it in the Events’ formatting:
`{has_website}Info …{/has_website}
So, what I want to do: If there is a website/URL to the event, that can be noted in the newly create “website” attribute field. So, when there is text in that attribute, a link (with the word “Info …” or an image) to that website will be displayed. If there is no text to that attribute, nothing will be displayed, neither the URL nor the word “Info …”. I guess I do need the customised conditional placeholder for that, right?
Best,
Stefan
Forum: Plugins
In reply to: [Customize Twenty Sixteen] Font “Song Myung”Thanks! I will try to figure it out.
Couple hours later I am smarter than before: I began to figure out the Attribute function. Very nice! I introduced three different values as a start, just to play around.
Now, could I use a Conditional Placeholder based on my new attribute’s value?
I would like on one page to only display events which have a specific value in that attribute. Is that possible?
Stefan
Forum: Themes and Templates
In reply to: index.php confuses me: just one post, mixing up several contentsAso, das also ist das sagenumwobene “Loop” :-). Danke, ich schau es mir an!
Stefan
Forum: Themes and Templates
In reply to: index.php confuses me: just one post, mixing up several contentsPlease excuse me for spamming this thread. But I tried to get my code example shown correctly. The last time, it worked fine :).
Forum: Themes and Templates
In reply to: index.php confuses me: just one post, mixing up several contents[duplicate posts moderated]
Forum: Themes and Templates
In reply to: WordPress is adding a “<p>” before the page’s contentI see that problem with all these format stuff. Now, also “<br>” signs are gone…
But well, maybe I can write them myself into the contentpages.
No chance, just to take away “” and keep the rest?
/Stefan
Forum: Themes and Templates
In reply to: WordPress is adding a “<p>” before the page’s content