Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- For Post Type
- <?php get_post_meta(get_the_ID(),'meta_key_name',true);?>
- ==============================================================
- For Register Customizer
- <?php theme_mode('meta_key_name');?>
- ==============================================================
- For Settings Items
- <?php get_option('meta_key_name');?>
- ==============================================================
- For Custom Widget
- <?php get_option('meta_key_name');?>
- ==============================================================
- For User Profile Items
- <?php echo get_avatar(get_the_author_meta("ID"));?> // avatar picture
- <?php echo get_author_posts_url(get_the_author_meta('ID'));?> // user profile url
- <?php echo ucfirst(get_the_author());?> // user name
- <?php the_author_meta('description');?> // user description
- <?php get_user_meta(get_the_author_meta('ID'),'meta_key_name',true);?> // from simple meta
- <?php get_field('user_social_profile','user_'.get_the_author_meta('ID'));?> // from ACF plugin
- ==========================================================================================
- // Attachment image info
- <?php
- $id = '_id';
- $meta_img_id = get_post_meta(get_the_ID(),"meta_name$id",true); // get id
- $alt = get_post_meta($meta_img_id, '_wp_attachment_image_alt', true); // alt text
- $meta_title = get_the_title($meta_img_id);
- ?>
- <?php
- $id = '_id';
- $meta_img_id = get_post_meta(get_the_ID(),"meta_name$id",true); // get id
- $args = array(
- 'post_type' => 'attachment',
- 'posts_per_page'=>1,
- 'post__in' => array($meta_img_id)
- );
- $attachments = get_posts($args);
- echo "<pre>";
- print_r($attachments);
- echo "</pre>";
- ?>
- <?php
- echo $alt = get_post_meta($meta_img_id, '_wp_attachment_image_alt', true);
- echo $attachments[0]->post_title;
- echo $attachments[0]->post_content;
- echo $attachments[0]->post_excerpt;
- ?>
- ====================================================================================
- // Get Theme information
- /**
- Theme Name: Philosophy
- Theme URI: https://rrfiroze.xyz
- Author: FIROZE ISLAM
- Author URI: https://rrfiroze.xyz
- Description: This is our pholosophy system theme.
- Version: 0.1
- License: GNU General Public License v2 or later
- License URI: LICENSE
- Text Domain: philosophy
- Tags: blog,education "https://make.wordpress.org/themes/handbook/review/required/theme-tags/"
- */
- <?php wp_get_theme()->get('Version');?>
- <?php wp_get_theme()->get('License');?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement