Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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
    Anne

    #1414079

    Hey 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,
    Mike

    #1414212

    Hello Mike,
    thanks a lot for the script. It works!
    Best regards
    Anne

    #1414216

    Hi,
    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

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘place a shortcode on top in migrated blog posts’ is closed to new replies.