Site logo

Archived topic

change content of archive custom post type

25 replies · Started by David on April 8, 2019

Viewing posts 16–26 of 26

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.
}
?>

<?php
/**
* 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 : ?>

<?php
the_content();

wp_link_pages( array(
'before' => '

',
) );
?>

<!-- .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.

Is it possible to open an external page in the modal? I'm not familiar with that library.

Awesome! Looks great :)

This archived topic is closed to new replies.