WordPress.org

Ready to get started?Download WordPress

Forums

Get the value from serialized custom fields (1 post)

  1. andreaamado
    Member
    Posted 3 years ago #

    I'm trying to get the value from serialized custom fields
    My _cp_showroom have this structure:

    Array
    (
        [home] => 1
        [cod] => 30408
        [tamanho] => 23
        [peso] => 0,25 Kg
        [attachment] => Array
            (
                [0] => Array
                    (
                        [url] => /2011/05/Banana-Bag-Runner1.jpg
                        [cor] => 8
                    )
    
                [1] => Array
                    (
                        [url] => /2011/05/Banana-Bag-Runner2.jpg
                    )
    
                [2] => Array
                    (
                        [url] => /2011/05/Banana-Bag-Runner3.jpg
                    )
    
            )
    
    )

    I'm trying this to get de 'home' key:

    $args = array (
    			   'cat' => 5,
    			   'showposts' => 4,
    			   'meta_key' => '_cp_showroom',
    			   'meta_value' => array( 'home' => 1 ),
    			   'meta_compare' => '='
    			  );
    $wp_query = new WP_Query( $args );

    Can anyone help me?

    Thank you...

Topic Closed

This topic has been closed to new replies.

About this Topic