Created
May 10, 2017 20:32
-
-
Save webbash/2d9b15e4edc298d37c45181286d8ede8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $posts = get_posts([ | |
'post_type' => 'slider' | |
]); | |
foreach ($posts as $post) : | |
$imgObj = get_post_meta($post->ID, 'image', true); | |
$label = get_post_meta($post->ID, 'definition', true); | |
echo "<pre>"; | |
var_dump($imgObj, $label); | |
echo "</pre><br>"; | |
if(!empty($imgObj)) | |
{ | |
echo "<img src='".$imgObj['guid']."' alt=''"; | |
} | |
endforeach; | |
$pod = pods('contacts'); // site_options - то что вы указали в Advanced, добавляя "Settings Page" | |
echo "<pre>"; | |
var_dump($pod); | |
echo "</pre>"; | |
// option_name - системное имя поля, которое вы хотите вывести | |
$pod->display('telephone', true); // вывести поле | |
$field = $pod->field('telephone', true); // получить значение поля | |
echo $field; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment