RSS/Atom feeds invalid, “Mismatched tag” errors

Upon closer examination of the output, all of the elements that did not have explicit closing tags were missing the self-closing notation i.e. <content … />; For some reason the functions.php file had these functions to “clean up” the output for HTML5: /********************************************** REMOVE SELF-CLOSING TAGS && USER-HARDCODED TAGS ***********************************************/ if ( !is_admin() && ( … Read more

Moving WordPress to a different directory – update XML Post File?

I would not recommend changing the XML file. When you move the WordPress installation to your root directory, you want to change the WordPress URL and Site URL options in your Admin > Settings. See official WordPress Codex page about Moving WordPress for more details. You can also manually change “siteurl” and “home” in the … Read more

Add valid XHTML closing img tags to WordPress galleries

As linked to from the comments on your question, the post_gallery filter should help you here. Unlike a lot of other hooks though, you can’t filter the output that comes through from WordPress; you can only provide your own alternative output. This is slightly annoying, and results in you needing to build the gallery from … Read more

Import post from XML files into custom post type programatically [closed]

After lot of searching about this functionality i have the solutions for this. Please check below example. global $wpdb; if (isset($_POST[‘submit1′])) { //$uri = get_template_directory_uri().’/xmlupload/’; $uri = wp_upload_dir(); $target_dir = $uri; $target_file = $target_dir . basename($_FILES[“fileToUpload”][“name”]); $filename = basename($_FILES[“fileToUpload”][“name”]); $filetypenew = wp_check_filetype($filename); $uploadOk = 1; $FileType = pathinfo($target_file, PATHINFO_EXTENSION); //$FileType = pathinfo($filetype,PATHINFO_EXTENSION); // Check if … Read more

How to assign name the WordPress export.xml file

By default, the filename is defined in /wp-admin/includes/export.php: $sitename = sanitize_key( get_bloginfo( ‘name’ ) ); if ( ! empty( $sitename ) ) { $sitename .= ‘.’; } $date = gmdate( ‘Y-m-d’ ); $wp_filename = $sitename . ‘WordPress.’ . $date . ‘.xml’; And you can filter it: $filename = apply_filters( ‘export_wp_filename’, $wp_filename, $sitename, $date ); So … Read more

wp_get_attachment_url images in wrong order [closed]

Gallerys aren’t implemented the way you’re pulling in images, the images in a gallery might not be attached to the post at all. get_attached_media will give you the images attached to the post by the order of their ID. This means: Images you added to the post, then deleted will be in this array Images … Read more

Rss error in first line of xml : not well-formed (invalid token)

You have additional code active there add this string inside the feed and destroy the XML markup. The hook on this place is rss_tag_pre (see https://github.com/WordPress/WordPress/blob/b3b8942dfcb451eddb5559b63c1043fce5d9449e/wp-includes/feed-rss2.php#L21). Deactivate all plugins, use a default Theme, and then, step by step, activate it again to identify the source for this problem. Alternative search about the wp-content directory for … Read more

How to import nested categories from XML file?

The following code snippet did the trick: <wp:term> <wp:term_id><![CDATA[1]]></wp:term_id> <wp:term_taxonomy><![CDATA[category]]></wp:term_taxonomy> <wp:term_slug><![CDATA[test-category-1]]></wp:term_slug> <wp:term_parent><![CDATA[]]></wp:term_parent> <wp:term_name><![CDATA[Test Category 1]]></wp:term_name> </wp:term> <wp:term> <wp:term_id><![CDATA[2]]></wp:term_id> <wp:term_taxonomy><![CDATA[category]]></wp:term_taxonomy> <wp:term_slug><![CDATA[sub-category-1]]></wp:term_slug> <wp:term_parent><![CDATA[test-category-1]]></wp:term_parent> <wp:term_name><![CDATA[Sub Category 1]]></wp:term_name> </wp:term>

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