• Resolved 0rca

    (@0rca)


    Hi there,

    first off: Awesome plugin, this suddenly opens a plethora of possibilities for a non-programmer like me. Thanks for that.

    One question though: How can I style elements? E.g. when I add the current post’s title via [content field=”title”] it is added in a code tag like this <code>title</code>
    is there a way to add a class to the shortcode? Or did I miss that in the description?

    https://www.ads-software.com/plugins/custom-content-shortcode/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Hello, thank you for the comment! I’m curious how people are using the plugin, so I appreciate the feedback.

    I looked into this, and found that only the menu had an option to add a div class. So I updated the plugin to include the same option for other fields, like this: [content field="title" class="title-style"]

    That’s strange you’re seeing code tags around the title. Sounds like the theme or another plugin might be filtering the output. I changed the way that the plugin gets the post title (more directly) so please let me know if that solves it. You might also want to try if this would strip the code tags: [content field="title" format="false"]

    Thread Starter 0rca

    (@0rca)

    Hi Eliot,
    thanks for your answer and especially for adding the CSS option, awesome!!
    Regarding the code tags, that was my own stupidity, I must have inserted the shortcode with the code tags, I guess by copy-pasting from here. Sorry, my bad, I should have checked that…

    Right now the inserted titles gets a before and a </p> afterwards. Any idea why?

    My text:
    <p>Wollen Sie mehr über [content field="title"] erfahren? Fragen sie uns! Wir stehen Ihnen gerne zur Verfügung.</p>

    Result as seen in Firebug:

    <p>
    Wollen Sie mehr über

    Software

    </p>
    <p> erfahren? Fragen sie uns! Wir stehen Ihnen gerne zur Verfügung.</p>

    [Moderator Note: Please post markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    Plugin Author Eliot Akira

    (@miyarakira)

    Thank you for telling me about the <p> formatting issue.

    The shortcode was filtering all output by default to add paragraphs and line breaks, with an option (format parameter) to turn it off. But I realized that it only makes sense to format the post content, and maybe in some cases if the field is a text area.

    I updated the plugin (version 0.3.3) so only the post content is formatted by default, and not other fields. Now your title should be displayed without paragraph tags.

    The formatting can also be turned on or off manually, by setting format="true" or "false".

    Thread Starter 0rca

    (@0rca)

    Works perfectly now. Thanks a million!!

    Plugin Author Eliot Akira

    (@miyarakira)

    Great, I’m glad it’s working well. Thanks for the good review too, it’s encouraging for me to keep improving the plugin.

    pronkman

    (@pronkman)

    Really great seeing the quick responses and incorporating user feedback – I would rate it 5 stars again if I could ??

    Plugin Author Eliot Akira

    (@miyarakira)

    Thanks for the kind words! I enjoy seeing people use what I’ve built, and it’s a good learning experience too. I plan to keep making it better, and also in the process of developing other plugins that work together with this one. If you have any suggestions, I started a new topic so please feel free to comment.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Styling of elements’ is closed to new replies.