• Resolved johnsut

    (@johnsut)


    The snippet below works as I would want it to.

    [loop category=my-stuff]
    [field title-link]
    [field image-link]
    [field excerpt more=”Read Full Post”]

    But I would like to display a shorter, linkable post title than [field title-link] outputs.

    Current Example:

    This is a very long post Title for XYZ (the title of the post and the output from [field title-link])

    Preferred Example:

    XYZ (the anchor text I want to use that links to “This is a very long post Title for XYZ”)

    I was hoping to find something like:

    [field tag-link] but to no avail

    I tried replacing [field title-link] with [taxonomy tag] – this worked to some extent as I got the post title I wanted but not the link back to the post itself in the title.

    Any help would be greatly appreciated. My first day with the plug-in and I am really impressed with it.

    Thanks
    John

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

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

    (@miyarakira)

    Hello,

    For this purpose, there is a [link] shortcode – its description can be found in the documentation under Main Features -> Field -> Link to field value. By default it links to the current post URL, and the link text can be placed between its open/close tags.

    [link][taxonomy tag][/link]

    I’m not sure if [taxonomy tag] would be suitable for all posts – there can be multiple tags for a post, in which case it will be displayed as a comma-separated list. And posts with the same tag(s) would be hard to distinguish maybe..? It depends on the context I guess. I imagine you could also limit the title length, like:

    [link][field title length=25][/link]
    Thread Starter johnsut

    (@johnsut)

    Many thanks for the very fast response.

    [link][taxonomy tag][/link]

    works fine for my particular needs, it would just have meant having to put a tag in about 12 posts.

    [link][field title length=25][/link]

    works perfectly, I figured out I just need to crop of the last word of each title (the same word) so I used a negative length, see below:

    [link][field title length=-7][/link]

    Many thanks for your help and for providing a great plugin.

    Regards
    John

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Title for [field title]’ is closed to new replies.