Is it possible to query a custom field and extract only part of it?

Hello,
I use the WP Review Pro plugin to write reviews of books and one of the fields I can fill in is an image of the book cover. I am trying to build a page that displays the book covers in a grid.

The custom filed I’m querying is called wp_review_schema_options. And the content of the field is the following:

a:23:{s:4:"Book";a:15:{s:4:"name";s:11:"Roma soy yo";s:11:"description";s:135:"El comienzo de una nueva saga, formada por 6 libros, sobre uno de los personajes más importantes de la historia romana, Julio César. ";s:5:"image";a:2:{s:2:"id";s:4:"7633";s:3:"url";s:119:"https://cdn.kevinmaschke.com/wp-content/uploads/2023/09/09181053/Roma-soy-yo_Santiago-Posteguillo_cubierta-262x400.webp";}s:9:"more_text";s:0:"";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:6:"author";s:20:"Santiago Posteguillo";s:11:"bookEdition";s:0:"";s:10:"bookFormat";s:9:"Hardcover";s:9:"publisher";s:0:"";s:14:"publisher_logo";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:13:"datePublished";s:10:"2022-04-05";s:11:"illustrator";s:0:"";s:4:"isbn";s:13:"9788466671781";s:13:"numberOfPages";s:3:"752";}s:6:"Course";a:8:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:6:"author";s:0:"";s:8:"provider";s:0:"";s:13:"provider_logo";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}}s:18:"CreativeWorkSeason";a:16:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:9:"startDate";s:0:"";s:7:"endDate";s:0:"";s:16:"numberOfEpisodes";s:0:"";s:12:"seasonNumber";s:0:"";s:7:"episode";s:0:"";s:12:"partOfSeries";s:0:"";s:6:"author";s:0:"";s:17:"productionCompany";s:0:"";s:8:"director";s:0:"";s:5:"actor";s:0:"";}s:18:"CreativeWorkSeries";a:10:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:9:"startDate";s:0:"";s:7:"endDate";s:0:"";s:4:"issn";s:0:"";s:6:"author";s:0:"";}s:7:"Episode";a:15:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:11:"dateCreated";s:0:"";s:13:"episodeNumber";s:0:"";s:12:"partOfSeason";s:0:"";s:12:"partOfSeries";s:0:"";s:6:"author";s:0:"";s:17:"productionCompany";s:0:"";s:8:"director";s:0:"";s:5:"actor";s:0:"";s:5:"genre";s:0:"";}s:5:"Event";a:16:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:9:"startDate";s:0:"";s:7:"endDate";s:0:"";s:13:"location_name";s:0:"";s:7:"address";s:0:"";s:9:"performer";s:0:"";s:5:"price";s:0:"";s:13:"priceCurrency";s:0:"";s:9:"offer_url";s:0:"";s:9:"validFrom";s:0:"";s:12:"availability";s:0:"";}s:4:"Game";a:7:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:6:"author";s:0:"";}s:5:"Hotel";a:11:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:10:"priceRange";s:9:"$10 - $30";s:15:"paymentAccepted";s:11:"Credit Card";s:18:"currenciesAccepted";s:3:"USD";s:7:"address";s:0:"";s:9:"telephone";s:0:"";}s:13:"LocalBusiness";a:11:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:10:"priceRange";s:9:"$10 - $30";s:15:"paymentAccepted";s:11:"Credit Card";s:18:"currenciesAccepted";s:3:"USD";s:7:"address";s:0:"";s:9:"telephone";s:0:"";}s:5:"Movie";a:13:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:11:"dateCreated";s:0:"";s:15:"countryOfOrigin";s:0:"";s:8:"duration";s:0:"";s:6:"author";s:0:"";s:8:"director";s:0:"";s:5:"actor";s:0:"";s:5:"genre";s:0:"";}s:13:"MusicPlaylist";a:8:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:9:"numTracks";s:0:"";s:5:"genre";s:0:"";s:6:"author";s:0:"";}s:14:"MusicRecording";a:13:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:8:"byArtist";s:0:"";s:8:"duration";s:0:"";s:7:"inAlbum";s:0:"";s:10:"inPlaylist";s:0:"";s:8:"isrcCode";s:0:"";s:11:"recordingOf";s:0:"";s:5:"genre";s:0:"";s:6:"author";s:0:"";}s:12:"Organization";a:6:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";}s:7:"Product";a:15:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:5:"brand";s:0:"";s:3:"sku";s:0:"";s:3:"mpn";s:0:"";s:5:"gtin8";s:0:"";s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:5:"price";s:0:"";s:13:"priceCurrency";s:0:"";s:12:"availability";s:0:"";s:9:"offer_url";s:0:"";s:15:"priceValidUntil";s:0:"";}s:6:"Recipe";a:18:{s:4:"name";s:0:"";s:6:"author";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:8:"prepTime";s:0:"";s:8:"cookTime";s:0:"";s:9:"totalTime";s:0:"";s:14:"recipeCategory";s:0:"";s:11:"recipeYield";s:0:"";s:16:"recipeIngredient";s:0:"";s:18:"recipeInstructions";s:0:"";s:13:"recipeCuisine";s:0:"";s:8:"keywords";s:0:"";s:8:"calories";s:0:"";s:10:"video_name";s:0:"";s:17:"video_description";s:0:"";s:12:"thumbnailUrl";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:10:"uploadDate";s:0:"";}s:10:"Restaurant";a:10:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:10:"priceRange";s:9:"$10 - $30";s:7:"address";s:0:"";s:13:"servesCuisine";s:0:"";s:9:"telephone";s:0:"";}s:19:"SoftwareApplication";a:11:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:5:"price";s:0:"";s:13:"priceCurrency";s:0:"";s:15:"operatingSystem";s:0:"";s:19:"applicationCategory";s:0:"";s:6:"author";s:0:"";}s:5:"Store";a:9:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:10:"priceRange";s:9:"$10 - $30";s:7:"address";s:0:"";s:9:"telephone";s:0:"";}s:8:"TVSeries";a:7:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:6:"author";s:0:"";}s:7:"Article";a:6:{s:8:"headline";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:6:"author";s:0:"";s:9:"publisher";s:0:"";s:14:"publisher_logo";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}}s:8:"Painting";a:8:{s:4:"name";s:0:"";s:6:"author";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";s:5:"genre";s:0:"";s:13:"datePublished";s:0:"";}s:5:"Place";a:6:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";}s:7:"WebSite";a:6:{s:4:"name";s:0:"";s:11:"description";s:0:"";s:5:"image";a:2:{s:2:"id";s:0:"";s:3:"url";s:0:"";}s:9:"more_text";s:8:"[ More ]";s:3:"url";s:0:"";s:16:"use_button_style";s:1:"0";}}

Is there anyway of just extracting the image URL from this?

Thanks!

Hello @Lunatic_Zorr,

Thanks for writing in!

Yes, you can run a Looper Provider/Looper Consumer to get the reviews.

Once you can get the items, you should be able to get the book cover. If you can get me WP Access, I would love to check and create a demo for you.

You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

Hi Ruenel,

Thank you for your reply. I’ve tried getting the image using the Looper Provider/Consumer but no luck so far.
I’ve created a user for you and added a secure note to my initial post.
For testing, I’ve used one of the templates that’s included and am trying to update it to get the image to display there, to learn how to display it. Feel free to edit the page as needed. The idea would be to only display the Book Cover images.

Example of the book cover can be seen here: https://www.kevinmaschke.com/en/i-am-rome-santiago-posteguillo/ at the bottom:

Thank you!

Hello @Lunatic_Zorr,

You will have to run a Looper Provider Query Builder to get all the post items and then you will have to nest a Looper Provider Dynamic Content “wp_review_schema_options” to get the Book details. Sample element structure:

Row - Looper Provider Query Builder
   Column - Looper Consumer
        DIV - Looper Provider Dynamic Content  "wp_review_schema_options" / Looper Consumer
            Image element - {{dc:looper:field key="Book.image.url"}}
       

You can check out the demo I have created on the given page above.

Best Regards.

Hi @ruenel

Oh wow! That’s amazing! Thank you! That is a perfect example :smile:
I’ve changed the looper provider from Latest Posts to a Query using the Query Builder to get posts only from one category. One thing I’ve noticed is that using WPML, I’ve copied the page into the other languages, and although the content is shown correctly, the Query Builder does show the taxonomies in one language only.

Is this a bug?

I’ve attached images below.

Hey @Lunatic_Zorr,

Please make sure that all your post items and your categories have been translated. If there are missing items, then that item must have NOT been translated into that language.

Could you please provide what items are missing?

Thanks.

Thanks,

My taxonomies are all translated as far as I can see. Doing some testing, it seems like Cornerstone displays the taxonomies in the language I am using in the WP Admin panel instead of the language I selected and am editing in in Cornerstone.

So if have selected German in WP-Admin as language in the WPML dropdown, and then open Cornerstone to edit a page, no matter what language I’m editing, the taxonomies are displayed in German. I’ve created a quick video demonstrating what I mean, and added the link below as secure note.

If I switch to a different language in WP-Admin before opening Cornerstone, the taxonomies are displayed in that language. I would expect Cornerstone to display the taxonomies in the language I am actively editing in Cornerstone.