Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1198066

    Liebes Enfold-Team, ich möchte auf den einzelnen Beitragsseiten meines Blogs das Beitragsbild automatisch im Layout angezeigt haben. Obwohl ich in den Theme-Einstellungen unter Blog-Layout -> Stil einzelner Beitrag -> die Option “Einzelpost mit großem Vorschaubild (vorgestellen Bild)” gewählt habe, wird das Vorschaubild im einzelnen Blogbeitrag nicht angezeigt.

    Wie kann ich das Beitragsbild automatisch ins Layout (gleich oberhalb des Beitragstitels) integrieren?

    Vielen Dank vorab!

    #1198121

    Hey simplystrategy,

    You can control the featured image display in the bottom right of the page in the layout box:
    Image 2020-03-26 at 17.22.57.png

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1198138

    Hi Victoria, thanks a lot for your quick reply. I already activated the option “Show on single entry”, nevertheless, the post format on the single page doesn’t show a preview picture. What else can I do?

    Thanks in advance

    #1198602

    Hi simplystrategy,

    Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?

    Best regards,
    Victoria

    #1198609
    This reply has been marked as private.
    #1198697

    Hi Christina,

    That option will work when posts are built with the Classic editor, if you build posts with the Advanced Layout Builder, you need to add the image or any slider on top of the page yourself.

    If the blog posts are simple, no complex Advanced Layout Builder elements used, you might want to use Classic editor, then you will have the image rendered automatically.

    Best regards,
    Victoria

    #1198720

    try this in your child-theme functions.php:

    Here you can choose which of the image formats commonly used in Enfold you would like to use.

    
    function thumbnail_in_content($atts) {
        global $post;
        return get_the_post_thumbnail( $the_id, 'entry_with_sidebar' );   // image-size you like to use - adjust to your needs
    }
    add_shortcode('postImg', 'thumbnail_in_content');
    
    add_filter('avf_template_builder_content', 'avf_template_builder_content_postimage_mod', 10, 1);
    function avf_template_builder_content_postimage_mod($content = "")
    {
      if(is_singular('post')  || is_singular('portfolio') ) {
        $featuredImage = do_shortcode("[postImg]");
        $content = $featuredImage . $content ;
      }
      return $content;
    }

    ______________________________________

    Just for Info – not to place in the child-theme
    these are the used image sizes in Enfold:

    $avia_config['imgSize']['widget'] 			 	= array('width'=>36,  'height'=>36);
    $avia_config['imgSize']['square'] 		 	    = array('width'=>180, 'height'=>180);
    $avia_config['imgSize']['featured'] 		 	= array('width'=>1500, 'height'=>430 );
    $avia_config['imgSize']['featured_large'] 		= array('width'=>1500, 'height'=>630 );	
    $avia_config['imgSize']['extra_large'] 		 	= array('width'=>1500, 'height'=>1500 , 
    $avia_config['imgSize']['portfolio'] 		 	= array('width'=>495, 'height'=>400 );
    $avia_config['imgSize']['portfolio_small'] 		= array('width'=>260, 'height'=>185 );	
    $avia_config['imgSize']['gallery'] 		 		= array('width'=>845, 'height'=>684 );
    $avia_config['imgSize']['magazine'] 		 	= array('width'=>710, 'height'=>375 );
    $avia_config['imgSize']['masonry'] 		 		= array('width'=>705, 'height'=>705 , 
    $avia_config['imgSize']['entry_with_sidebar'] 	= array('width'=>845, 'height'=>321);
    $avia_config['imgSize']['entry_without_sidebar']= array('width'=>1210, 'height'=>423 );
    #1199042

    Thanks a lot for solving my problem!!
    Best regards

    #1199371

    Hi simplystrategy,

    Glad you got it working for you with Guenni007’s help! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1202606

    just for info: we do not need the shortcode

    and because on the most cases it makes no sence on showing the featured image on a post or portfolio created with advanced layout builder – we can use the meta box setting of showing or not showing the featured image.

    add_filter('avf_template_builder_content', 'avf_template_builder_content_postimage_mod', 10, 1);
    function avf_template_builder_content_postimage_mod($content = "")
    {
      if(
      	is_singular('post') && ( '1' != get_post_meta( get_the_ID(), '_avia_hide_featured_image', true ) ) 
      	||  is_singular('portfolio') &&  ( '1' != get_post_meta( get_the_ID(), '_avia_hide_featured_image', true ) ) 
        ) 
      {
        $featuredImage = get_the_post_thumbnail( $the_id, 'entry_with_sidebar' );
        $content = $featuredImage . $content ;
      }
      return $content;
    }
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.