Custom Posts/Taxonomy displaying with normal post types.

Posted in: Newspaper
Post count: 14

Hello there…

So I want to have a series of custom posts that are assigned to a specific category show up in a standard posts query for say most recent or whatever. I have some PHP code that should append the query loop with the proper calls for the custom posts but they are not showing in the tagdiv custom loops. BUT if I go to a static page they do show up in the standard WP latest posts.

On top of this if I try to set just the custom post’s category in the query loop of say most recent posts or something for testing they do not show up at all. If I go to a category page for that category they do show up.

Post count: 14

I use the snippets plug in to run code and not modify functions.php

Just for reference since is the code that should append.

add_filter( ‘pre_get_posts’, ‘add_sby_videos’ );

function add_sby_videos( $query ) {

if ( is_home() && $query->is_main_query() )
$query->set( ‘post_type’, array( ‘post’, ‘sby_videos’ ) );

return $query;
}

Post count: 21065

Hello @sjgold !

In order to avoid misunderstandings, please provide more information(screenshots/video) about what exactly you need to achieve or what is the issue there and your website link.

A solution for sending a screenshot/video is this:
Download, capture, and send: https://www.techsmith.com/jing-tool.html
After making the screenshot, you will have a link; paste it here.

Thank you!

Post count: 14

Hi, I am not sure what more I can explain.
I pull information from the Youtube API and a custom post is created. I want to have those items in the custom post show up in a standard query loop result from the tagdiv loops. But it does not, nor can i just filter to that category and have it show up.

It will show up if i set things to be a static page that just displays the most recent posts if i include the code piece i added but it will not show up in a tagdiv results loop. what other information do you need?

Post count: 14

Let me try to explain with images…
https://imgur.com/a/7p5OZbe

So the first image shows what I refer to as the query loop and the results it gives. As you can see the first post is the Warhammer post.

Then we changed the settings so the homepage is just the latest posts. You will note there are 2 posts above the Warhammer post, which is due to the custom posts that are generated from the YouTube API and pushed into WordPress. This is due to the code we inserted into the standard YouTube query that appends in the proper custom posts.

The query is shown in the last image and this is the standard way that you would do this according to WordPress. I believe that you are NOT generating the info in the blocks the standard way which is stupid if that’s the case. I assure you this is 100% why I bought the theme as you stand it will deal with custom posts… but your definition of custom posts is more custom fields like ACF would do.

Then I show you that it is pulling all categories, and I show you moving to just the category that contains those custom posts and how it comes back with no results.

Post count: 21065

Hello @sjgold !

We recommend you to use a static page for your homepage and choose the one you use from that dropdown, so you can customize it with the TagDiv Composer.
Please note that you can not display both posts and CPTs in a tagdiv block, only posts or only CPTs. The code you applied only affects the standard WordPress loops while our loops work differently.

Thank you!

Post count: 14

I will use a static page, I was showing you it should work.

The fact that you do not support standard WordPress loops is pretty much a reason to ask for a refund. I showed you that I can not even get JUST the custom posts in the blocks.

Do you have any code that would work for your loops? How would I get just the Custom posts to show up?

Post count: 21065

Hello @sjgold !

Unfortunately, this is not implemented in the theme already.
For customization and other services, you can contact our custom work team here: https://tagdiv.com/premium-customization-services/.
Display a CPT like this: https://prnt.sc/o5Yh76qttY_t
Documentation here: https://forum.tagdiv.com/flex-block-settings-guide/

Thank you for your understanding!

Post count: 14

I am very tempted to contact theme forest for a refund, it will depend on the answer to the width question.
I’m quite disappointed in the theme so far, I dont think it has any improvement over the theme I currently use, which has 2+ years of customization and tweaking. I was hoping for something more modern, but some things about this theme are absolutely backwards

  • This reply was modified 2 years by sjgold.
Post count: 14

[Question Deleted]

  • This reply was modified 2 years by sjgold.
Viewing 10 posts - 1 through 10 (of 10 total)
The forum ‘Newspaper’ is closed to new topics and replies.