• I am trying to use a custom template that would show some of the custom fields. The fields show up when I am using the default template, but they come up blank using my custom template. Is anything else needed in the template then this line

    $lcp_display_output .= $this->get_custom_fields($this->params[‘customfield_display’], $single->ID);

    ?

    FYI: I am calling it with this shortcode:
    [catlist name=testimonials excerpt=yes orderby=ID order=desc posts_morelink=”Read more” template=”testimonialtemplate” customfield_display=”testimonialauthor” customfield_display_name=”no”]

    https://www.ads-software.com/plugins/list-category-posts/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Yes, i’d like to know too. i’m having the same problem with the latest version and had to downgrade to 0.50.3 for one of my site just because it needs to display custom fields in a custom template.

    can anyone who knows, shed some light on how to fix this?

    Same issue as kilzac & gaborpor. Looking forward to a fix. This is a fine plugin, many thanks to the author.

    Same problem for me ??

    Hi,

    It seems that there has been a change in LCP v0.51 to the get_custom_posts function so it now takes only one parameter. I’ve replied to a similar query just now and reproduce the reply here as you may find the quick fix helps you at least for now:

    I’ve found a bug in the LCP version 0.51 lcp-catlistdisplayer.php code.
    In an older version which I have the get_custom_fields function used to have several parameters, the first of which was the setting of customfield_display. For some reason, the author has removed that and the function now only has the post_id as a parameter passed to it.

    For a quick fix if you change this line in your template:
    $lcp_display_output .= $this->get_custom_fields($this->params[‘customfield_display’], $single->ID);

    to
    $lcp_display_output .= $this->get_custom_fields($single->ID);

    you may find it works. Let us know, because there must be hundreds, if not thousands, of templates that are now broken.

    Just a thought, it may be sensible to leave both your old line in as well as put in the new line, just in case the author ever goes back to the old way (or you go back to an older version of the plugin).

    ***CORRECTION***

    sorry, the author has also changed the way the post id is send to get_custom_fields so your new line should be:
    $lcp_display_output .= $this->get_custom_fields($single);

    ie without the ->ID (he now picks up the info about whether customfields are to be displayed from the object, so you don’t need to send the parameters separately).

    Great workaround! I can confirm that it works ??

    Yup, i can confirm it works too. many thanks AACT!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘customfield_display in custom template’ is closed to new replies.