Site logo

Archived topic

Posts page as company job postings

24 replies · Started by Royce on February 7, 2022

Viewing posts 16–25 of 25

Ok, let's try adding this function now:

add_filter( 'generate_do_template_part', function( $do, $template ) {
    if ( 'none' === $template && ! have_posts() ) {
        $do = false;
    }

    return $do;
}, 10, 2 );

Does that remove the "No Results" message? If so, try re-activating the Element - any change?

Hi Tom,

Thanks for the suggestion.

I tried it, and it gets rid of the "No Results" message, but activating the Element also returns the empty container with padding.

Could we get an Admin login so we can see whats going on ?

Hi David,

I sent you the log in details for the admin account access.

Hmmm... nothing jumps out as to why its showing a content template when no posts are present. Very odd. I have asked Tom to take a look.

I adjusted the function you're using to add the no jobs hook using a filter to include telling the Content Template not to appear if they are no posts:

add_filter( 'generate_element_display', function( $display, $element_id ) {
    if ( 2039 === $element_id && have_posts() ) {
        $display = false;
    }
	
    if ( 675 === $element_id && ! have_posts() ) {
        $display = false;
    }

    return $display;
}, 10, 2 );

It seems to have fixed the issue. Can you confirm?

Hi Tom,

Thanks for the update.

It seems to have fixed the problem on desktop, but the element is still showing up on my mobile and tablet screens (on actual mobile and tablet - it's not appearing using Chrome dev tools with the dimensions adjusted.)

I'll have to try and check on other devices I dont own and get back to you.

Will revert soon, thanks so much for the help.

No problem! :)

Hi Tom! Looks like your fix worked. Thank you so much to you and the team for the help.

I've marked the issue as solved.

Thanks again!

Glad we could help! :)

This archived topic is closed to new replies.