Site logo

Archived topic

PHP Question

3 replies · Started by Rob on January 9, 2019

Viewing posts 1–4 of 4

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?

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?

Thanks Tom.

I had missed the ? from the <php :/

Ha! Sorry I didn't catch that :)

This archived topic is closed to new replies.