Skip to content

Instantly share code, notes, and snippets.

View shahidulislamus's full-sized avatar

shahidul islam rony shahidulislamus

View GitHub Profile
@shahidulislamus
shahidulislamus / Custom post query with custom field wordpress
Last active August 29, 2015 14:14
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);
?>