Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Jesper K. Pedersen

    (@jesperkp)

    I ended up writing a small javascript that ran after my recent post was loaded and stripped the width, height and style attribute from the figure tag, and applying my own style to them through this style:

    .front-news-sect figure {
    	width: 150px;
    }
    
    .front-news-sect .size-medium {
    	width: 100%;
    	height: 100%;
    }

    The size-medium is to have the image fill the figure block.

    My JavaScript looks like this:

    <script>
    //Fix figure tags for size restrictions imposed by WordPress
    var sectarr = document.getElementsByClassName('front-news-sect');
    var scnt = sectarr.length;
    
    for(i=0;i<scnt;i++){
      var figarr = sectarr[i].getElementsByTagName('figure');
      var icnt = figarr.length;
    
      for(j=0;j<icnt;j++){
    	figarr[j].removeAttribute('height');
    	figarr[j].removeAttribute('width');
    	figarr[j].removeAttribute('style');
      }
    }
    </script>

    After a little bit of digging I found the problem.

    The “Simple Staff List” plugin require the running theme to have support for the “post-thumbnails” functionality.

    So this need to be run in the theme functions.php

    add_theme_support( 'post-thumbnails' );

    Running WordPress ver. 4.9.5–da_DK and Simple Staff Listing ver. 2.0.3 then I run into the same problem with no picture block available when running my own theme.

    When I go to the “Edit Staff Member” page I get this:

    
    ( ! ) Warning: in_array() expects parameter 2 to be array, string given in /www_root/dbwk.famped.dk/wp-includes/theme.php on line 2629
    Call Stack
    #	Time	Memory	Function	Location
    1	0.0007	324800	{main}( )	../post.php:0
    2	0.4905	28907120	include( '/www_root/dbwk.famped.dk/wp-admin/edit-form-advanced.php' )	../post.php:174
    3	0.4918	28910784	current_theme_supports( )	../edit-form-advanced.php:69
    4	0.4918	28911136	in_array ( )	../theme.php:2629
    

    Switching to another official theme does not give me the above error and I get the picture option on the “Edit Staff Member” page.
    Any ideas what is wrong?

Viewing 3 replies - 1 through 3 (of 3 total)