Title: Featured with XPath
Last modified: April 4, 2019

---

# Featured with XPath

 *  Resolved [libellulas](https://wordpress.org/support/users/libellulas/)
 * (@libellulas)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/featured-with-xpath/)
 * Hi,
    I am using all import plugin with real homes add-on.
 * I want wp-all-import to set the featured properties if the node “Frazione” is
   equal to “Collina”.
 * So i generate this php function:
 * > function my_set_featured( $frazione ) {
   >  if ( $frazione == “Collina” ) { return“
   > yes”; } else { return “no”; } }
 * And I set the featured property based on xPath code with the function:
 * > [my_set_featured({frazione[1]})]
 * If I put the code inside the content box the preview of the function works, but
   when I I import the properties no properties has featured checked.
 * Can you help me?
    Thanks!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffeatured-with-xpath%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/featured-with-xpath/#post-11397410)
 * Hi [@libellulas](https://wordpress.org/support/users/libellulas/)
 * You actually need to import “0” for no and “1” for yes, so you should be able
   to fix this by changing your code to:
 *     ```
       function my_set_featured( $frazione ) {
       	if ( $frazione == "Collina" ) {
       		return "1";
       	} else {
       		return "0";
       	}
       }
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Featured with XPath’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-import/assets/icon-256x256.png?rev=2570179)
 * [WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets](https://wordpress.org/plugins/wp-all-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-import/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-import/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * Last activity: [7 years, 2 months ago](https://wordpress.org/support/topic/featured-with-xpath/#post-11397410)
 * Status: resolved