Tagged: post migration, short code, standard editor
-
AuthorPosts
-
July 21, 2023 at 12:15 pm #1413946
Dear Kriesis,
I need to migrate very many posts from from another WP CMS. These posts are created in the standard editor and all changes are made in the database and the migration is done via a script. Unfortunately, so far it is not possible to place the shortcode for an ad banner above the featured image. Please see the linked images.
Is there a possibility to migrate the old posts to a template (ALB-template or PHP-template) where the shortcode appears above the featured image? The manual editing is too much work because there are too many posts.All new posts are created with the Advanced Layout Editor with the shortcode in the right position. Everything is nice there.
For any questions please ask.
Best regards
AnneJuly 22, 2023 at 9:54 pm #1414079Hey annevoelkel,
Thanks for the link to your site and the screenshots, to move the ad before the featured image try this script:function adblock_before_featured_image() { ?> <script> window.addEventListener("DOMContentLoaded", function () { (function($) { $('.single .post-entry').each( function() { var featuredImage = $(this).find('.big-preview.single-big'); var adBlock = $(this).find('.a-single.a-80'); $(adBlock).insertBefore($(featuredImage)); }); })(jQuery); }); </script> <?php } add_action('wp_footer', 'adblock_before_featured_image');This works in my test on your post and I tried to check a few more posts to ensure that they would all have the same class for the ad but I found no other posts with ads to check.
Best regards,
MikeJuly 24, 2023 at 11:49 am #1414212Hello Mike,
thanks a lot for the script. It works!
Best regards
AnneJuly 24, 2023 at 11:55 am #1414216Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘place a shortcode on top in migrated blog posts’ is closed to new replies.
