Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shahidulislamus/64c1f0e4ec725d5df232 to your computer and use it in GitHub Desktop.
Save shahidulislamus/64c1f0e4ec725d5df232 to your computer and use it in GitHub Desktop.
hear "put_hear_custom_field's_variable"="custom field's value pass by its variable" ===========hear "job_link"="pass that variable's value into this" ==========hear "put_hear_your_post_type_neme"="put hear the custom post type name i mean register_post_type('this name'array());"
<?php
global $post;
$args = array( 'posts_per_page' => 10, 'post_type'=> 'put_hear_your_post_type_neme' );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<?php
$job_link= get_post_meta($post->ID, 'put_hear_custom_fields_variable', true);
?>
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
<p><?php echo $job_link; ?></p>
<?php endforeach; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment