Hi,
I've a query, please.
How can I customise the output/result text from a shortcode? I would like to know how to change its font family, size, etc.
Thanks,
Rajiv
Hello,
WordPress shortcode won't setup text font size + type by default.
You can consider these:
1) Create two custom post fields, for example:
- font-size
- font-type
https://toolset.com/course-lesson/creating-custom-fields/
2) In the post content, setup the DIV tag with HTML codes manually, for example, in a shortcode block, display below codes:
<div style="font-size: [types field='font-size'][/types]px; font-style: [types field='font-type'][/types];">
...
Here display something
...
</div>
More help:
hidden link
I am unable to understand, Luo. Probably there could be a simpler solution.
In the numerical output from the shortcode, I would like to know the default font and font size that it selects. I would like to change those parameters. May I know where Toolset picks them from?
Thank you.
To avoid more misunderstandings, please elaborate your questions with more details:
In the numerical output from the shortcode, I would like to know the default font and font size that it selects. I would like to change those parameters. May I know where Toolset picks them from?
Which shortcode are we talking about? please provide detail steps to reproduce the same problem, thanks
This is the only shortcode output where I would like to tweak the font and its size:
[wpv-items-count] of [wpv-found-count] results
The shortcodes you mentioned above won't output any font CSS styles, it can only output result in plain text directly.
But you can customize it by HTML + CSS codes, for example:
<div style="font-size: 25px; font-style: italic;">
[wpv-items-count] of [wpv-found-count]
</div>
See the document I mentioned above:
hidden link
hidden link
Yes! It worked. That was what I was looking for. Thank you for helping out, Luo. Appreciated.