-
AuthorPosts
-
February 23, 2015 at 1:15 pm #400617
Hi,
I try to customize the Magazine module displaying excerpt below title or preferable a custom field in the footer field in magazine.php.
I use types for custom fields and the php code looks like this:
types_render_field("my-date", array("style" => "calendar"))
or just simply the excerpt.I’m pretty fresh to php and have only been learning some simple things yet
How can I implement this within this:
$output .= "<footer class='entry-footer'></footer>";
Thanks!
February 24, 2015 at 10:55 am #401279Hi lipstick!
Thank youm for using our theme.
As much as I’ve seen the mentioned function returns a string.
So you can use it like this:
$my_fields = types_render_field("my-date", array("style" => "calendar")); $output .= "<footer class='entry-footer'> . $my_fields . </footer>";
Probably you need to do some CSS for the output in custom.css or Enfold->Styles->QuickCSS.
Best regards,
GünterFebruary 24, 2015 at 1:28 pm #401381Hi,
Thanks for your answer. I have tried this, but it doesn’t solve my problem. If test the code and I use:
$eventdate = get_the_title($entry->ID); $output .= "<footer class='entry-footer'>" . $eventdate . "</footer>";
This displays the title right. But when I try to use the types php code nothing shows.
$eventdate = types_render_field("event-date", array("style" => "text"));
This means that there’s a problem getting the custom field with php I think. I have also tried to insert the custom field value with Types shortcode into a post and this works fine – which rules out that there’s something wrong with the custom field setup.
I have sent a support ticket to Types developers, but if you have a suggestion to how to solve this I would appreciate it!
Thanks!
February 24, 2015 at 3:16 pm #401453Hey!
Thank you for coming back.
I’ve never used this plugin, I only had a short look at the documentation homepage.
I would like to help you, but it is bejond the scope of this support forum, as it will take some time to study the documentation and test it.
Probably you will get a solution from the plugin authors.
What you need is a HTML code for output of the fields and this should work with the solution I gave you above.
Cheers!
Günter -
AuthorPosts
- You must be logged in to reply to this topic.