Export all posts to import as product items

You don’t have to export and then re-import, you can do it all via the API in one go, no XML required. here’s a quick example plugin: <?php /* Plugin Name: WPA_convert_types */ function wpa_convert_types_page() { add_management_page( ‘WPA convert types’, ‘WPA convert types’, ‘manage_options’, ‘wpa_convert_types’, ‘wpa_convert_types_render_page’ ); } add_action(‘admin_menu’, ‘wpa_convert_types_page’); function wpa_convert_types_render_page() { if( isset( … Read more

Adjust the order for returned posts

In order to accomplish what you desire, you’ll have to fetch the posts ahead of time. There is no way to specify in SQL an arbitrary ordering given an ID list. query_posts() creates another main query, throwing out the main query. Since you’re doing this anyway, you can use get_posts() to return a list of … Read more

Delete all Tag Links from Posts

1) For existing post content, you can add a filter to the_content to remove them from the output before they are seen by a user: function remove_tag_links( $content ) { return preg_replace( ‘#<a [^>]*\bhref=\\\?”[^”]+(?=/tag/)[^”]+\\\?”[^>]*>(.+?)</a>#si’, ‘$1’, $content ); } add_filter( ‘the_content’, ‘remove_tag_links’ ); 2) For new / updating content, you can add the same filter to … Read more

How to repeat a loop after 4 posts [duplicate]

Assuming that you’re only using the counter to decide what style to use, the easiest way to achieve what you want would be to reset the $count variable once it gets to 4. <?php elseif ($count == 4) : ?> <div>Styled post 4</div> <?php $count = 0; ?> <?php else : ?>

displaying the categories post

That happens because the_content() contains already an echo. PHP tries to create the string before it sends it to the echo command. While the string is evaluated the content will be printed already. Then echo gets what was not yet printed: the li tags. So the simple fix is: echo ‘<li>’; the_content(); echo ‘</li>’;