How to get jetengine’s meta field in php

How to get jetengine's meta field in php

Some of developers want to get page/posts meta fields in php code and want to run query with it or create shortcode and get jetengine’s meta field in it.

There are 2 methods to get post/page meta field created via Jetenigine Plugin.

  • Jetengine method.
  • WordPress default method.

If you’re creating a WordPress site and want to display specific information from your pages or posts, you must use code to do it. This data is referred to as “JetEngine’s meta fields.” Developers frequently use these fields to provide custom functionality or display unique content.

There are two straightforward ways to obtain meta fields with the JetEngine plugin:

  • 1. JetEngine Method: Use JetEngine’s native capabilities to quickly locate and show the information.
  • 2. WordPress Default Method: You can obtain the same data using WordPress’s basic features.

Both techniques are effective, depending on what you require for your website!

1. Jetenigne method

$page_links = jet_engine()->listings->data->get_meta( 'related-extra-pages-link' );

echo '<p>' . $page_links . '</p>'; 

2. WordPress default method

get_the_ID() is post/page id. you can also type it like e.g. 14 or 55.

$page_links = get_post_meta( get_the_ID(), 'related-extra-pages-link', true );

echo '<p>' . $page_links . '</p>'; 

Hope this help you to create a better website and solve your problem 🙂

get jetengine’s term meta field value in php

GitHub Gist link

Was this article helpful?
YesNo
Abdullah Khalid web developer profile pic

Need help in fixing your website?

Hi! I'm Abdullah & I specialize in Custom theme, Elementor, and Crocoblocks. Let’s work together to bring your ideas to life.

Have any Questions?

More Articles