Created
March 22, 2016 05:55
-
-
Save MasterHans/8a0f1b19f28014a3da2d 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 | |
global $post; | |
global $wp_query; | |
$currentPageCatId = get_cat_ID( "pagename" ); | |
$NewsCatPostsArray = query_posts( 'cat='.$currentPageCatId); | |
$current_news_postId = $NewsCatPostsArray[$i]->ID; | |
$current_news_postUrl = get_permalink($current_news_postId); | |
$query_images_args = array('post_type' => 'attachment', 'post_mime_type' =>'image', 'post_status' => 'inherit', 'posts_per_page' => -1,'post_parent' => $current_news_postId); | |
$query_images = new WP_Query($query_images_args); | |
$images = array(); | |
foreach ( $query_images->posts as $image) { | |
$images[]= $image->guid; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment