Create custom page in WooCommerce

Create a new page in /wp-admin (in the left column: Pages -> Add New); create new custom page template after reading through this doc; put your code in there; go into the page you created in #1 and assign the page template to it (in the right column, Page Attributes box, the drop-down under ‘Template’ … Read more

parse XML from URL (via SOAP)

Lots of places in WordPress use xml_parse including the Atom library, the XML-RPC Library that we use, and SimplePie The oembed class uses SimpleXML. The WordPress Importer and Jetpack actually use both (Jetpack for different things, and the importer tries to use SimpleXML and falls back if it doesn’t exist). Basically, there’s nothing built into … Read more

Localizing text from XML files

You should use a localized XML format like XLIFF or TMX , there is a tool to convert XLIFF to .po. If you cannot change the source XML you have a few options but it really depends how your outputting this XML info: Parse the XML ( for label) and create a .po with gettext … Read more

How do you get all the urls of images attached to a post?

You need to loop through the attachments within your post loop, replace the section of code you posted with this (put this together from some other code I found related to a similar problem, but couldn’t test it): </BasicDetails> <?php $args = array( ‘post_parent’ => $post->ID, ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, // show all … Read more

How to read the xml file in wordpress?

WordPress bundles and wraps SimplePie class for feed download, caching and processing. Retrieving namespaced data with it would be something like this: $feed = fetch_feed( ‘http://www.wdcdn.net/rss/presentation/library/client/iowa/id/128b053b916ea1f7f20233e8a26bc45d’ ); $items = $feed->get_items(); foreach ( $items as $item ) { $credit = $item->get_item_tags( ‘http://search.yahoo.com/mrss/’, ‘credit’ ); var_dump( $credit ); } See fetch_feed() in Codex.

How to re-Import the WordPress XML file after editing?

What do you need to edit and why can’t you edit in the WP editor? Can you use Search RegEx? It’s a plugin to search and replace with grep and regular expressions through content. If you need to develop a regex search string to find certain content, check https://stackoverflow.com/questions/tagged/regex

With WordPress Importer, why can’t I import post meta containing a multi-dimensional array, in which value(s) of that array contain line breaks?

I would wage that your issue is with \r\n (CRLF). If the newlines are created in Windows, they’ll go into the database as \r\n and when serialized get counted as 2 characters. Then when importing, they’ll only be counted as 1 character and they’ll corrupt the string. I tested this hypothesis and sure enough I … Read more

Hook for URL Request

Actually, my recommendation would be to do things a bit differently. You can add a custom rewrite endpoint to WordPress to handle these files specifically. For example, the URL http://site.com/download-xml/the_filename would automatically download the specified file as an attachment. First, you need to add a custom rewrite endpoint to set this up: function add_endpoint() { … Read more

Plugin or advice on how to parse XML in real-time?

You could the following to achieve this in the “WordPress way”: Add code via plugin or child theme In the code add a wp cron task The task should get the file with wp_remote_get Parse the xml file with SimpleXMLElement Update the content to meta fields of the post with update_post_meta You could display the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)