• Resolved seank123

    (@seank123)


    I have set up two templates:

    Staff Member – shows a custom post
    Staff Member Archive – lists the posts in the custom post

    But I cannot get the archive template to show any image fields or HTML.

    The Staff Member template:

    <div id="staff-page">
    <div class="company-details">	
    	{@location.cover_image._img}<br>
    
    {@location.company_name}<br>
    
    	</div>	
    	
    <div id="staff-details">
    
    {@photo._img.thumbnail}<br>
    
    {@first_name} {@last_name} <br>
    {@job_title}<br>
    
    </div>	
    
    	
    {@location.phone}	
    </div>

    This works fine: https://demo.brandsavvy.co.uk/staff-member/john-smith/

    The archive template:

    <ul class="staff-list">
    <li><img class="staff-image" src="{@photo._src.thumbnail}" />
    <div>{@first_name} {@last_name}</div>
    [if location]<div><strong>Location:</strong> {@location}</div>[/if]
    </li>
    </ul>

    This shows the text fields (first_name, last_name and location) but not the image nor is the being rendered: https://demo.brandsavvy.co.uk/staff-member/

    What am I doing wrong?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @seank123

    Looking at the rendered HTML I seems like your template isn’t linked correctly.
    Not sure why the location is shown anyway but the HTML markup is totally different.
    Could you check your auto template configuration?

    Cheers, Jory

    Thread Starter seank123

    (@seank123)

    Thanks

    It’s set like this: https://ibb.co/gwrhWkB

    Thread Starter seank123

    (@seank123)

    After a bit of investigating I have found that it appears to be a theme issue.

    I use Generate Press Pro – but if I change the theme to TwentyTwenty or TwentySeventeen it works!

    But TwentyNineteen doesn’t work either!

    Thread Starter seank123

    (@seank123)

    After a bit of playing I found that setting the ‘Archive Template Filter’ to the_excerpt (was the_content by default) foxed it in GeneratePress!

    Although, it breaks it in the other themes – so looks like maybe a GeneratePress issue.

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @seank123

    This is indeed variable. Some themes could use other filters. Also your archive content setting in Settings > Reading could affect this (full content or excerpt).

    Thanks for letting us know!

    Cheers, Jory

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Template problem’ is closed to new replies.