Skip Navigation

[Resolved] Custom Author archives page doesn't show the associated posts

This support ticket is created 4 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 10 replies, has 2 voices.

Last updated by RobertB7373 4 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#1744029

Hi,

I have a custom archive page that should show also the author's posts, but because of a reason that I can't figure out, it doesn't work. Also I can't display the authors description, simply does not appear in the available options.
hidden link
hidden link

Could you help me,

Thank you,
Robert

#1744621

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

Thank you for getting in touch.

Would you mind allowing me to have admin access to the site so that I can have a look at this for you in more details ?

The private fields will be enabled for your next response.

Thanks,
Shane

#1745437

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

Thank you for the credentials.

I was able to have a quick look at the website for you and the issue is occurring with not just the Authors archive but any of the Preview that the archive is meant to be used for.

This means that the archive isn't displaying anything for the Year etc.

From this we need to go through the standard debugging steps in order for us to identify the cause of the issue. Here are a few things I would like for you to do.

1. Disable all the non-toolset plugins and check on the frontend to see if the posts start showing up. If they do this means we have a plugin conflict.

2. Change to a wordpress default theme with your non-toolset plugins disabled and check the frontend again.

3. Recreate the Archive and see if the same issue still remains.

Once you've gone through these steps please let me know if the issue remains and we can move further with debugging from there.

Thanks,
Shane

#1745721

Hi Shane,

I just did all these and it's still the same.

Robert

#1745843

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

Thank you for running these checks for me.

Would you mind if I took a copy of the website so that I can test it out on my end ?

This will help to eliminate the possibility of this being issues with the server.

Please let me know so we can go to the next step.

Thanks,
Shane

#1745861

Yes of course! I just want to solve this issue asap.

#1748619

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

I was able to work up what was the issue here. The custom Author Archive will only display information from the default Post type for wordpress.

What you will need to do is to hook into this and add the other additional post types to the archive. You can do this with the hook below.


    function post_types_author_archives($query) {
        if ($query->is_author)
                // Add 'car' CPT and the default 'posts' to display in author's archive
                $query->set( 'post_type', array('car', 'post') );
        remove_action( 'pre_get_posts', 'custom_post_author_archive' );
    }
    add_action('pre_get_posts', 'post_types_author_archives');

Add it to your Toolset custom code section in Toolset -> Custom Code and add this snippet above, ensuring that it is activated.

Now you will need to modify the $query-set by adding the slug of your custom post type into the array. As you can see for my example I've added 'car' and 'post' which are my custom post type as well as the default post type.

Please try this and let me know if it helps.
Thanks,
Shane

#1748949

My issue is resolved now. Thank you!

#1749171

Hi Shane,

I have another 2 questions, however they are not related to the first topic.

1.) Basically on each page I have 3 individual and independent “views”. On the first “view” I would like to display the latest post from the the other 2 “views” but of course they should have to know which one appears on the first ‘“view” and they should skip that one.
Every post have a checkbox for “Recommended” article, if it’s selected, the first “view” should skip the latest articles from the other 2 “views” and show just the recommended article. In that scenario the other 2 “views” should show the latest article as well without skipping them.

2.) It’s unclear for me if the “Cache View” should be toggled “on” or “off” where I’m showing just 4 items, so I don’t have pagination.

Thank you again,
Robert

#1753885

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Robert,

Given that we have resolved the issue that this thread was opened for, you will need to open a new ticket in order for us to address your other issues that you are having.

I will recommend closing this ticket and opening a new one with the issues you have described.

Thanks,
Shane

#1754519

thx.