[Resolved] change content of archive custom post type

Home Forums Support [Resolved] change content of archive custom post type

Home Forums Support change content of archive custom post type

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • #871198
    David

    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;

    ?>

    #871821
    Tom
    Lead Developer
    Lead Developer

    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 ๐Ÿ™‚

    #872292
    David

    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;
    }

    #872760
    David

    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

    #872772
    Tom
    Lead Developer
    Lead Developer

    Did you change anything in the archive template? Looks like the grid is showing up, but nothing inside the grid elements.

    #872775
    David

    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.

    #873045
    Tom
    Lead Developer
    Lead Developer

    Can you show me your archive template? You can use GitHub Gists or pastebin to share the code.

    #876667
    David

    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

    #877040
    Tom
    Lead Developer
    Lead Developer

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

    #877406
    David

    Hi Tom

    Got this sorted with this code…

    https://pastebin.com/wRLRJaU9

    http://185.20.51.60/~skyworldco/team/

    Thanks
    Dave

    #877711
    Tom
    Lead Developer
    Lead Developer

    Awesome! Looks great ๐Ÿ™‚

Viewing 11 posts - 16 through 26 (of 26 total)
  • You must be logged in to reply to this topic.