• Hello,
    I was wondering if there might be a way to display custom fields.
    I added a custom field “external_link” to tags and I’d like to display an icon next to each tag, linked to this external link, when it exists.
    I also added an “image” field to a custom taxonomy and I’d like to show it the same way it’s now possible to do for posts with the “thumbnail” and “thumbnail_linked” options.

    I know that custom fields can be infinite and therefore difficult to manage with shortcodes but maybe is there a way to ‘inject’ them into the code using PHP?

    Thank you!

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

    (@tugbucket)

    Sorry for the delay.

    Short answer is yes. Long answer, you kinda nailed it, “I know that custom fields can be infinite and therefore difficult to manage with shortcodes”

    What you can do is copy the plugin folder and put that copy in your theme root folder. If you look at: https://plugins.svn.wordpress.org/multi-column-tag-map/trunk/mctagmap.php you’ll see the chuck of code under “/* load the PHP*/” and that code looks in your theme for the mctagmap_functions.php file. If it exists, the plugin will use that file rather the the file in the plugins/ folder. So you can make code edits in that copy file and they won’t be overwritten when you update the plugin.

    Then under the line: “elseif($show_posts == “yes”){” you’ll see the get_posts code and you can then change the query to grab all your custom fields. Than modify your output later in the file to display your new HTML.

    Thread Starter jibril84

    (@jibril84)

    Thank you! Somehow I managed to get the links to appear! It will probably be more complicated with the images but I’m already happy with it 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display custom fields’ is closed to new replies.