Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7428201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:42:25+00:00 2026-05-29T08:42:25+00:00

I have wordpress page with content and image gallery. when i print_r my content,it

  • 0

I have wordpress page with content and image gallery. when i print_r my content,it shows like below

    stdClass Object
(
    [ID] => 4558
    [post_author] => 1
    [post_date] => 2011-09-22 05:34:44
    [post_date_gmt] => 2011-09-22 05:34:44
    [post_content] => 

Nayer has pursued her passion for art since childhood. 
She believes that art should have a positive influence in the world and on our life experiences. 
She studied in Persia at Tehran University and at California State University, Los Angeles.



    

        [post_title] => About the Water Artist
        [post_excerpt] => 
        [post_status] => publish
        [comment_status] => open
        [ping_status] => open
        [post_password] => 
        [post_name] => about-the-water-artist
        [to_ping] => 
        [pinged] => 
        [post_modified] => 2011-11-22 04:59:58
        [post_modified_gmt] => 2011-11-22 04:59:58
        [post_content_filtered] => 
        [post_parent] => 0
        [guid] => http://nagu.wordpress.net/?page_id=4558
        [menu_order] => 0
        [post_type] => page
        [post_mime_type] => 
        [comment_count] => 0
        [ancestors] => Array
            (
            )

        [filter] => raw
    )

from the above response in [post_content] i found gallery shortcode . the images are not shown.

Is there any possibility to extract the images url alone using that shortcode from post content?.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T08:42:26+00:00Added an answer on May 29, 2026 at 8:42 am

    I use below code for extract images from gallery shortcode, It’s working.

    <?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;
                                            }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a wordpress-generated page where I need some posts (in a specific category)
what I have: a google search form (displayed on all pages) a wordpress page
I have configured WordPress to display a static front page as described here: http://codex.wordpress.org/Settings_Reading_SubPanel#Reading_Settings
I have a WordPress site (2.6.2) in which I have set the Home page
I have a blog (wordpress) and a facebook fan-page for my blog (with more
I have built a site in wordpress and the home page is really screwed
I have a PHP page, in Wordpress. When I add a inline Thickbox to
My wordpress is not setting the front page correctly, I have several pages, all
I'm making a custom page template in wordpress and adding an image by using
I have an anchor element like this: <a href=/link-to-image/ rel=attachment wp-att-7076><img src=/uploads/img.jpg alt= title=

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.