Archived topic
change content of archive custom post type
25 replies · Started by David on April 8, 2019
I have this at the moment...
<?php
/**
* The template for displaying posts within the loop.
*
* @package GeneratePress
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
?>
/**
* generate_after_entry_header hook.
*
* @since 0.1
*
* @hooked generate_post_image - 10
*/
do_action( 'generate_after_entry_header' );
if ( generate_show_excerpt() ) : ?>
<?php else : ?>
the_content();
wp_link_pages( array(
'before' => '
'after' => '
',
) );
?>
<!-- .entry-content -->
<?php endif;
?>
Try this:
add_filter( 'wp_get_attachment_image_attributes', function($attr) {
if ( is_singular( 'team' ) ) {
$attr['class'] .= ' modal-link iframe';
}
return $attr;
} );
Let me know :)
Hi Tom
I've added this to the functions.php but no luck...
// ADD POP LINK TO TEAM ARCHIVE PAGE //
add_filter( 'wp_get_attachment_image_attributes', function($attr) {
if ( is_singular( 'team' ) ) {
$attr['class'] .= 'modal-link iframe';
}
return $attr;
} );
I've also got this in my functions.php, could it be affecting it...
// CROP SIZE OF TEAM FEATURED IMAGE IN ARCHIVE //
add_filter( 'generate_blog_image_attributes','tu_variable_image_sizes' );
function tu_variable_image_sizes( $atts ) {
// Set up our conditional
if ( is_post_type_archive( 'team' ) ) {
$atts[ 'width' ] = 800;
$atts[ 'height' ] = 553;
$atts[ 'crop' ] = true;
}
// Return our options
return $atts;
}
Hi Tom
I'm randomly now not seeing any off the team on the archive page.
Do you have any ideas why this could be?
Thanks
Dave
Did you change anything in the archive template? Looks like the grid is showing up, but nothing inside the grid elements.
Nope haven't changed anything in the archive template - only think I've done is update the premium gp plugin, plus run a import for joomla to wordpress to import the news articles but nothing has changed on the team side of things.
Can you show me your archive template? You can use GitHub Gists or pastebin to share the code.
Hi Tom
Im trying to set up remodal now on the archive page, to load the single page in to a pop up window...
https://github.com/VodkaBears/Remodal#remodal
Any ideas of what I need to do to get it to load the page in pop up.
Here is my archive page...
https://pastebin.com/rfn9xcrV
Thanks
Dave
Is it possible to open an external page in the modal? I'm not familiar with that library.
Awesome! Looks great :)