2017-02-17 22 views
1

我有一個XML有兩個元素名稱<picture><url>,我使用WP所有導入來獲取圖片元素同時下載圖片我希望元素超級鏈接圖片元素。WP All導入圖像編輯

我的代碼:

function my_custom_func() { 
    [email protected][1]; 
    [email protected][1]; 
echo '<a href=$url> <img url=picture[1] /> </a>'; 
} 

,但沒有成功,任何幫助!

的XML

<element1> 
    <picture> 
    http://pictureurl.image/image.jpg 
    </picture> 
    <url> 
    http://url.image/image.jpg 
    </url> 
</element1> 

回答

0

我怎麼會到它:

function my_custom_func($url, $image) { 
return <a href = $url> <img url = $image>; 
} 

在外地加入這個你想在

[my_custom_func({url[1]}, {picture[1]})]