Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date_tag and date_class aren't honored when using (default) template #286

Closed
pezcurrel opened this issue Jan 7, 2018 · 3 comments
Closed

Comments

@pezcurrel
Copy link

pezcurrel commented Jan 7, 2018

Hi,
when using...

[catlist name="segnalazioni" pagination="yes" numberposts="20" excerpt="yes" date="yes" date_tag="p" date_class="lcpt_date" thumbnail="yes" thumbnail_class="lcpt_thumb"]

...I get the correct html for the date:

<p class="lcpt_date"> 13 dicembre 2017 </p>

But when I add a template (based on the default.php, or even the default one copyied to theme-dir/list-category-posts and renamed to "defaultone"), like this...

[catlist name="segnalazioni" pagination="yes" numberposts="20" excerpt="yes" date="yes" date_tag="p" date_class="lcpt_date" thumbnail="yes" thumbnail_class="lcpt_thumb" template="defaultone"]

...date_tag and date_class are ignored so I get the date without the <p class="lcpt_date"> and </p>.
The default template (default.php) states...

$lcp_display_output .= ' ' . $this->get_date($post);

I worked around the issue by changing that to this...

$lcp_display_output .= '<p class="lcpt_date">' . $this->get_date($post) . '</p>';

...but it's an ugly solution ;)

@pezcurrel pezcurrel changed the title date_tag and date_class isn't honored when using (default) template date_tag and date_class aren't honored when using (default) template Jan 7, 2018
@klemens-st
Copy link
Collaborator

@pezcurrel You can pass html tag and css class as arguments to the get_date method, like so: $this->get_date($post, 'p', 'lcpt_date')

@picandocodigo this is exactly what I was referring to in my last comment in #284 😉

@klemens-st
Copy link
Collaborator

You can close the issue @pezcurrel if you managed to resolve the problem 🙂

@pezcurrel
Copy link
Author

Ok, I'll close it since it's already discussed in #284 (I agree with you @zymeth25 that shortcode parameters should take precedence over function arguments). Thanks for helping :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants