Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #958193

    So, after researching how best to do this in this form…for enfold of course, I have created a new function and added a shortcode for it. I drop a CODE tool on my page inside a column and add the new shortcode reference…and no one is more surprised than I, viola, I see my output. HOWEVER, that output is in the upper top left of my page content, just below the header. My expectation was that, by virtue of the aria containers and layout paradigm, that the output would have occurred exactly (ok roughly) where I placed my CODE tool on the page.

    Why does it not and how do I stop that from happening. The actual custom code just creates a

      tag set of bullet items to display from my media directory of relevant PDFS as links to those files…and again keep in mind that it works, just displays in the wrong place.

    #958979

    Hey mcraig,

    Where can we see the element in question? If you could share the code you are using then that would be helpful as well.

    Best regards,
    Rikard

    #959498
    This reply has been marked as private.
    #959976

    Hi,

    Please try it as following

    function boardminutesqv() {
      $args = array(
    	  'post_type' => 'attachment',
    	  'post_status' => 'inherit',
    
    	  // for PDFs    
    	  'post_mime_type' => 'application/pdf',
    
    	  // if you need PDFs from a specific media category
    	  'tax_query' => array(
    		  array(
    			  'taxonomy' => 'media_category', // your taxonomy
    			  'field' => 'id',
    			  'terms' => array(143,145) // term id (id of the media category)
    		  )
    	  )
      );
    
      $query = new WP_Query( $args );
    
      if ( $query->have_posts() ) {
    
              $output = ''
    
    	  $output .= '<ul>';
    
    		  while ( $query->have_posts() ) {
    			  $query->the_post();
    			  $output .= '<li><a href="' . get_the_permalink() . '">' . get_the_title() . '</a> (' . filesize( get_attached_file( get_the_ID() ) ) . ' bytes)</li>';
    		  }
    
    	  $output .= '</ul>';
    	  return $output;
      }    
      else {
    	  // no PDFs found
      }
    
      wp_reset_postdata();
    }
    add_shortcode( 'wpb_boardminutesqv', 'boardminutesqv' );

    and now let me know if it works properly.

    Best regards,
    Basilis

    #963154
    This reply has been marked as private.
    #964554

    Hi,

    Sorry for the late reply!

    I attached a screenshot showing one issue i noticed. If that was what you menat, please edit your column element and delete background image from your column element :)

    Best regards,
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.