stuartm-2
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Repeatable PDF images broken v2
Started by: stuartm-2
in: Toolset Professional Support
Problem: When the field is repeatable it works as i want it to - show image and on click open related PDF file, but when the field has only one file it shows and image and on click it opens the image on a tab which i dont want - I need the PDF file. How to make this work the same for one file? Solution: It is a custom PHP codes problem, see details here: https://toolset.com/forums/topic/repeatable-pdf-images-broken-v2/#post-1291597 Relevant Documentation: |
2 | 7 | 5 years, 6 months ago | ||
Ajax filtering issue with Relevanssi
Started by: stuartm-2 in: Toolset Professional Support |
2 | 8 | 5 years, 6 months ago | ||
Conditional output based on post relationships dosent work
Started by: stuartm-2 in: Toolset Professional Support |
2 | 12 | 5 years, 9 months ago | ||
Repeatable PDF images broken
Started by: stuartm-2
in: Toolset Professional Support
Problem: The issue here is that the user had some custom code to display the pdf on their page as an image, however this was not working for repeatable fields. Solution: I've made some modifications to the original code and it should now allow for this with the repeatable fields. function getPDFimg($atts) { extract( shortcode_atts( array( 'size'=>'full', 'url'=>'' ), $atts ) ); $image_url = str_replace(".pdf", "-pdf.jpg", types_render_field( "files-for-approval", array('output'=> 'raw'))); // publication_document = your field name $dirname = str_replace('.jpg','',str_replace(home_url('/'),'',$image_url)); $images = glob($dirname."*.jpg"); if(isset($images[0])){ $small_image = home_url('/').$images[0]; } if(isset($images[1])) { $medium_image = home_url('/').$images[1]; } if(isset($images[2])) { $large_image = home_url('/').$images[2]; } switch($size) { case 'small': if(isset($small_image) && $small_image != '' ) { $image_src = $small_image; } else{ $image_src = $image_url; } break; case 'medium': if(isset($medium_image) && $medium_image != '' ) { $image_src = $medium_image; } else{ $image_src = $image_url; } break; case 'large': if(isset($large_image) && $large_image != '' ) { $image_src = $large_image; } else{ $image_src = $image_url; } break; default: $image_src = $image_url; } $img_arr = explode(" ",$image_src); $output = ""; foreach($img_arr as $img){ $output .= "<a href='".str_replace("-pdf.jpg",".pdf",$img)."'><img src='".$img."'/></a>"; } return $output; } add_shortcode('getpublicationpdfimg', 'getPDFimg'); Example usage. |
2 | 16 | 5 years, 9 months ago | ||
How to Filter a View of CPT 1 based on information stored in related CPT 2
Started by: stuartm-2 in: Toolset Professional Support |
2 | 4 | 5 years, 9 months ago | ||
Related posts dosent give me the View im going after.
Started by: stuartm-2
in: Toolset Professional Support
Problem: I have a View of posts that displays a table of information. In the last column, I would like to display information about the most recent related post. Solution: Create two Views, one for displaying the table and another for displaying the related post. Nest the View of related posts inside the table View. In the View of related posts, add a post relationship Query Filter set by the current post in the loop, limit the results to 1 result, and sort by post date in descending order. |
2 | 8 | 5 years, 9 months ago | ||
Comment section is off by default.
Started by: stuartm-2
in: Toolset Professional Support
Problem: I would like to "Allow comments" on all new posts in my CPT, and I don't want to check the checkbox every time in the post editor screen. Solution: Edit the post type and turn on the Comments option. The comment section will appear in the post editor screen once the post is published. |
2 | 10 | 5 years, 11 months ago |