[Resolved] PHP Question

Home Forums Support [Resolved] PHP Question

Home Forums Support PHP Question

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #777515
    Rob

    Hi there, I know this isn’t Generatepress related, but just hoping you guys can help, as your always very kind to me with your knowledge.

    I am using Pods, I have created a custom field called “part_number”. Im trying to insert this Custom field in to my WooPack Product Slider.

    The shortcode for the Pods Custom Field dont work, Pods have suggested using get_post_meta within the PHP file. Now I have my div class placed exactly where I want it on the slider. But just need to output the custom field.

    I have tried to learn this myself, but I am no way a developer so I dont know what Im doing! This is what my primative brain has put. But im reading “as long as its in the loop” on websites, that may as well be French.

    <div class="woocomm-part-number">
        	<h4>Part Number: <php echo get_post_meta(get_the_ID(), 'part_number', true);?></h4>
        </div>

    Would you guys know the exact PHP to put in my file?

    #777834
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Your code looks like it should work for you, as long as part_number is the name of the custom field.

    Sometimes there’s an underscore before the custom field name: _part_number

    Might be worth trying?

    #778204
    Rob

    Thanks Tom.

    I had missed the ? from the <php :/

    #778471
    Tom
    Lead Developer
    Lead Developer

    Ha! Sorry I didn’t catch that 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.