• Hi, there,

    So, I’m using CPTUI Extended on the following sites (demos)
    1. 22
    2. Naicom

    What I find is on the one the Naicom site, I use the following tags in my code

    <a href="<?php echo get_author_posts_url(get_the_author_meta('ID'), get_the_author_meta('user_nicename')); ?>"><?php the_author(); ?></a> and yet it doesn’t pull the author into the frontend; also using

    <?php the_content(); ?>

    doesn’t pull content into the frontend, and you can inspect to see.

    Another snag I ran into is in the case of the 22 site, when I click on author name “kabolobari” is returns a Page not found not to list of post by this author as defined by the posts under this Updates post types.

    I don’t know how to fix any of this and pressed that you take a look. Haven’t had any issues relating to CPT ever since I’ve used it. Thanks.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Can you provide some specific links for where you’re not seeing he output you’re expecting? Also what shortcodes are you using for this? It’s possible that the templates used for the shortcode output are being edited with this information.

    Not sure what’s going on with the author URL and why it’s returning a WordPress 404. Something with the query, likely.

    What post types/taxonomies do you have registered at the moment?

    Thread Starter Kabolobari Benakole

    (@kbooshco)

    Should I create an admin account for you, in case it helps you investigate properly?

    So, for this link https://demos.oosh.co/naicom/news/digital-media-centre/ you don’t see the_content() outputted. However, on the archive page https://demos.oosh.co/naicom/news/ content shows; then if you click on a category archive, say “Digital” as in, https://demos.oosh.co/naicom/category/digital/ it returns a 404 Nothing found.

    For the 22 site, everything works fine, except the author link which returns nothing found.

    Is there a way to direct message you admin details in case that helps you take a better look? Thanks.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    set up a user for michael @ webdevstudios . com and I can look things over closer.

    For what it’s worth, I’m not seeing anything for CPTUI-Extended template output, which has me thinking it’s issues with the active theme more than the plugins.

    May need to flush permalinks for some details.

    Thread Starter Kabolobari Benakole

    (@kbooshco)

    I’ve just temporarily allowed file edits from admin, in case you need to be able to inspect the template codes.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Alrighty, you should be good to go now on all fronts.

    the_content issue()
    https://demos.oosh.co/naicom/news/digital-media-centre/

    This was an issue because you didn’t instantiate the WordPress loop in the template being used. The if ( have_posts() ) : while( have_posts() ) : the_post(); and closing endwhile; endif; Because of this, some of the template tags being used for the author link, were either returning nothing or giving a silent fatal error. This is why you never saw the post content. It never reached it. Once I get the loop set up, it all fell into place.

    Category archives
    https://demos.oosh.co/naicom/category/digital/

    The issue with this one is that post types are not automatically added to core category/tag archives. We have docs about the topic at https://docs.pluginize.com/article/17-post-types-in-category-tag-archives. HOWEVER CPTUI-Extended provides UI settings for this, so that you don’t have to. At the very bottom of the post type editor screen for CPTUI is an “Extended” section with some extra features. I have checked both “category” and “tag” settings and hit save for you. The news items should now be appearing in the category archives, like expected.

    Author archive issue
    Very much like the category/tag issue above, author archives do not get custom post types automatically added. Unlike categories/tags, though, CPTUI-Extended doesn’t presently have a UI checkbox for this one. So, in the 22 site, I added a code snippet to the functions.php file, very similar to how we do for cats/tags, and it should now be showing the posts from the updates post type in your author archive. I am also going to be opening an enhancement issue for CPTUI-Extended for adding to author archives. However, that will need to be a future release there.

    Thread Starter Kabolobari Benakole

    (@kbooshco)

    Wow, thanks, a lot, you’ve done a lot for me. Let me take a look.

    Thread Starter Kabolobari Benakole

    (@kbooshco)

    I got mislead a bit…it’s actually in the templates-tag.php file that you added the do_author_archive function, and not the functions.php file…made me go down a rabbit hole to figure it out…meantime, since you’re explicit with ‘updates’ do I have to do this for every post type I create? And, you know I have a lotta post types for the Naicom site. Isn’t there a way to make it dynamic

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Oops, sorry about the mixup on files. I do think it still worked out in the end though, for what it’s worth. The template-tag.php file is probably loaded by functions.php, thus it still worked.

    Yes, you would, regarding specifying post types to include. If you check out https://docs.pluginize.com/article/17-post-types-in-category-tag-archives, you’ll see the section Adding all CPTUI post types to the archives. which would fetch and append all of the CPTUI post types to the spot. This would need to be done for the author archives snippet. For any that are related to category/tag archives, you’ll just need to check the appropriate setting like I mentioned previously. Those can be done as you create each post type.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    From Twitter:

    is it possible to make the cpt archive show up in pages, assigned a page template, and edited from the admin area?
    

    You can use CPTUI-Extended to create a shortcode that queries for the latest posts from the post type, and place that shortcode in the page content. This would use the page template selected for the overall page layout. The shortcode itself would use the internal templates provided by CPTUI-Extended, and those would be displayed within the confines of wherever the_content() shows.

    The shortcode essentially provides an easy way to provide arguments for a custom WP_Query and displays the results in place. If I recall right, it does also support pagination of the CPT posts.

    If you’re just trying to create a URL to see your post type posts at, I’ll recommend looking a making sure has_archive is set to true, and look into creating an archive-{$my-cpt-slug}.php file to use for customizing it’s display. This would be outside the context of a page, but still offers a fair amount of flexibility.

    Thread Starter Kabolobari Benakole

    (@kbooshco)

    Ok, this helps. So in essence, you’re saying if I wanted a page in my admin Page listing, I could create a page. Then create a shortcode within CPTUI-X that queries and pulls all the posts under the CPT in question. Then place that shortcode within the new page’s text editor (for the_content()) and that should do it?

    I need to learn how to use CPTUI-X to create shortcodes then.

    Thanks.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Should have a TinyMCE button to help and guide you through all that.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Certain Tags Don’t Populate’ is closed to new replies.