-
Author
Tagged: custom post author archive
-
December 3, 2015 at 08:36 #90873lelooshParticipant
Please refer to screenshot and this live site page: http://libanville.com/user-post (Custom User Post Archive Page)
There is a discrepancy between #1 & #2:
——————————————– #1
Kleo’s custom type archive lists the custom posts in a masonry grid, each custom post in this grid has a link to the custom post’s author archive as:
http://libanville.com/author/%username%Also the right sidebar (SRP Special Recent Posts Pro plugin) has also custom post’s author archive links to:
http://libanville.com/author/%username%See where red arrows are pointing to in screenshot.
——————————————– #2
The author’s ACTUAL archive on the other hand resides in:
http://libanville.com/%custom-post-type-name%/author/%username%a live site example is at:
http://libanville.com/user-post/author/christianObviously if you use the authors archive’s links in the theme’s masonry grid you will get a 404 page error.
Interesting Note: I also have on the website a section for REGULAR POSTS not CUSTOM POSTS:
http://libanville.com/lebanon-fashion-beauty
But the link to their author archive (View All Posts by ….) seems to work fine:
http://libanville.com/author/editorHow can the CUSTOM POST’s AUTHOR ARCHIVE LINK be resolved?
Attachments:
You must be logged in to view attached files.December 4, 2015 at 09:23 #91114LauraModeratorHello, will assign the ticket to a higher support level who can help and advise you in your query.
Thanks! 🙂Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
December 8, 2015 at 19:03 #91924AndreiModeratorI didn’t get what’s the page you have the issue with the 404 error, can you give us a link example to such page ?
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionDecember 8, 2015 at 20:11 #91943lelooshParticipantGo to the archive page for custom post type: user-post
http://libanville.com/user-post
Click on “A Film Noir” – “View All Posts by Christian” ***** SEE SCREENSHOT *****
Clicking will send you to an empty page (Author Archive for: Christian):
http://libanville.com/author/christianWhen actually Christian’s Archive is in:
libanville.com/user-post/author/christianThere’s the discrepancy!
Attachments:
You must be logged in to view attached files.December 8, 2015 at 20:18 #91949AndreiModeratorWell,
The main/default author archive is the one ( http://libanville.com/author/christian ), the links to your custom post type author archive is an optional link, it works because it knows under what post type to look for posts.
The main author archive by default won’t include any custom post types, that’s why it won’t list anything.
I think the best approach in your case would be to find a small piece of code to make your archive listing include your custom post types. Here are some examples: http://designpx.com/tutorials/custom-post-types-author-archive/
Please note that this is the default way wordpress works, and is nothing influenced by our theme.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionDecember 9, 2015 at 06:01 #92034lelooshParticipantThe problem with extending WP as a CMS with custom posts that things DO NOT WORK right out of the box and it needs to be tweaked for even something as basic as an author’s archive using a custom post type.
I tried the example in your link in my child’s functions.php and it didn’t work.
I’m not a PHP programmer so I would probably need to use the services of WPFIXIT.com or try freelancer.com
Thanks anyway.
December 9, 2015 at 16:37 #92100AndreiModeratorIndeed, wp can be extended and used as a full cms solution, but often will require custom developments.
In this case I have added and tested the code and it works, maybe you forgotten to clear the cache after applying the code. Also please be sure you don’t have any plugins active that you don’t use because it might slow down your site.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionDecember 9, 2015 at 17:04 #92111lelooshParticipantThanks Andrei,
This is the code I used from your link referral:
COPY CODEfunction custom_post_author_archive($query) { if ($query->is_author) $query->set( 'post_type', function custom_post_author_archive($query) { if ($query->is_author) $query->set( 'post_type', array('wp_plugin_review', 'client', 'post') ); remove_action( 'pre_get_posts', 'custom_post_author_archive' ); } add_action('pre_get_posts', 'custom_post_author_archive'); ); remove_action( 'pre_get_posts', 'custom_post_author_archive' ); } add_action('pre_get_posts', 'custom_post_author_archive');
I want to display the author archive who uses a custom post type “submit-post” as slug, so I think I replaced in the code array(‘wp_plugin_review’, ‘client’, ‘post’) with submit-post.
Is that similar to what you did?
December 9, 2015 at 17:07 #92113AndreiModeratorYou can see the function i used in kleo-child/functions.php at the end of the file.
Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionDecember 9, 2015 at 17:26 #92121lelooshParticipantOh I see you changed it ON MY WEBSITE, I thought you tried it somewhere else.
I see the change now.
Thanks a lot Andrei!
December 9, 2015 at 17:28 #92122AndreiModeratorYeah, your custom post type should be included now into the default author archive as well.
The pleasure was mine, Cheers
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘Bugs & Issues’ is closed to new topics and replies.