PHP Code Widget
[resolved] Using and displaying data from the custom fields (3 posts)

  1. ucarmetin
    Posted 5 years ago #


    I'm using the plugin and must admit it has saved me a lot of time and effort. It works like charm.

    However, I got a problem. I have a custom field where a sub title can be attached to the posts. I want this custom field to be displayed on the sidebar via the plugin. I wrote the appropriate code but it doesn't display the value of this custom field. Here you can see my code. What am I doing wrong?


  2. Samuel Wood (Otto)
    WordPress.org Tech Dude
    Plugin Author

    Posted 5 years ago #

    Code in the widget runs in a function call, and so you have to declare that you want access to global variables.

    Try adding <?php global $post; ?> to the top of your code.

  3. ucarmetin
    Posted 5 years ago #

    Hej Otto,

    Thanks for the help. The issue is resolved.


Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic