How to register multiple post types that lead single post page? [SOLVED]

Hi to all,

Im having problem to show registered custom postype in my site. I have done it like landy app exsample and its show post what i add. but it wil not go in single page when i press button.

Do i need custom archive.php file or single-{post name}.php file to show custom single post.

picture to problem:

Hi @Pepe, can you post the HTML snippet of the HTML element where you loop through posts, so that we can take a look?

Adding Post Link action should generally be enough to link to the post, regardless of what type it is. index.php / singular.php are used if single-{post name} doesn’t exist.

Hi, Matjaz

Its little weird, when i coded custom post type, same way like landy_app example it worked
perfect, but when i tryed to add own post type with own name it goes directly 404 page.

<pre>
  <code>
<div class="card-columns " style=" 
max-height: auto;
">
    <div class="card" id="blogi-card" style=" 
max-height: 600px;
" wp-loop="blocks_query" wp-loop-order="ASC" wp-loop-orderby="ID" wp-loop-post-status="publish" wp-loop-post-type="post" wp-loop-posts-per-page="3" wp-loop-has-password="false" wp-loop-post-type-custom="blocks"> 
        <img class="card-img-top" src="http://pinegrow.com/placeholders/img16.jpg" alt="Card image cap" wp-the-post-thumbnail="array(300,300)" wp-the-post-thumbnail-if="true" style="
max-height: auto;
max-width: auto;
margin-left: auto;
margin-right: auto;
" cms-post-image> 
        <div class="card-body" style=" 
"> 
            <h4 class="card-title" cms-post-title>Title</h4> 
            <h6 class="card-subtitle mb-2 text-muted" cms-post-date>
field title</h6> 
            <p class="card-text" cms-post-excerpt>Some quick example text to build on the card title and make up the bulk of the card's content.</p> 
            <a href="#" class="btn btn-info btn-uusi" cms-post-link>Koodi</a> 
        </div>         
    </div>     
</div>





  </code>
</pre>

Here is picture my pinegrow dashboard, if this helps.

What is the URL on the link with Post link action when you run it in the browser?

Perhaps there is a problem with how the permalinks are configured?

Hi @matjaz

I get it work but not the way its should be. There must be bug in Pinegrow or Localwheel database.

BUG is Custom post type >>> To move look that post.

Case 1.):
When you make theme and and register CUSTOM post type in Worpress action it works like it should. Bug is, when you register another custom post type, it will work and show post but not going single.post page anymore.

This error happend if you have posted something in first Custom postype, like my case i posted testi( test article)

This case i had to delete my site and all included files.

After that I installed New Worpress site with new database. After that exported same theme to new site and its works.

My recomendation if you have same problem:
When you register CUSTOM post type, don’t post any custom post article in there, if you are not 100% sure you want another CUSTOM post type in your site.


Its working this metod, but it will not make sense to install webpage and database again.

pst… I really love pinegrow <3, it would be nice if these problem will be fixed… :slight_smile:

Thanks for the info @Pepe!

Did you use unique post type ids for different custom post types?

For example, if two different post types are registered with the same id “blocks” this will create a conflict in the WP. The same could happen if there is a plugin that registers a post type “blocks” and then your theme does the same. One way to avoid conflicts is to prefix your CTP ids: “mytheme_blocks”, “mytheme_projects”…

I did test, and added new CPT id: “pecodex_product” and named “product_query” in loop, but it has no effect.

Picture of my sql database:

When i delete that record, it has no effect, really intresting.

After reading your feedback, I have tested registering/using custom post types and found no particular issue …

@Pepe Can your please contact the support so we can have a look at your situation? (and share some project files).

I contacted to support team and provided ondrive link.

I tried one more thing that unistalled pinegrow in my pc and then reinstalled again. It was no effect. My operation system is windows 10 64-bit, can it be a problem?.

Issue is fixsed

Discussing with the pinegrow support, they gave good advice.

After registered custom post type ( cpt ) refresh permalink in worpress dashboard. That fix the issue and all cpt’s works like they should.

Note: You have to refresh always when make NEW cpt.

cptfix

Thanks @Pepe

First important point for us is that this issue is not related to Pinegrow :slight_smile: :champagne:

Then, regarding the instructions from the screenshot, I think that just clicking on Save changes should be enough (I mean, no need to select the Custom structure option first.)

Cheers.

Regarding this particular topic, we have posted a new section here: