Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

custom-post-types

Adding Custom Post Types to category/tag/author archives breaks header content

The amazing @Krzysiek Dróżdż was right on the money on this one! I can’t believe nobody has picked it up until now. The code I was using has been shared on all sorts of well-known/well-referenced sites, as is, and NOBODY has fixed it to include is_main_query. Revised code, for anybody else who’s searching: // Add … Read more

Categories custom-post-types Tags archives, categories, custom-post-types

Group Custom Posts Types in a Relation field of ACF

Group Custom Posts Types in a Relation field of ACF

Categories custom-post-types Tags custom-post-types, filters, query-posts

Display relationship between posts

Display relationship between posts

Categories custom-post-types Tags custom-post-types

Custom post type pagination problem – page 1 and 2 show same content

Making the following changes to the CPT registration, and then flushing permalinks, solved the issue: Changed the rewrite slug to ‘faq’ Changed ‘has-archive’ to true instead of ‘faq’ I did #1 so that my archive page URL would still be /faq, and the side effect is that the single questions are now faq/question-name instead of … Read more

Categories custom-post-types Tags archives, custom-post-types, pagination

How to get post detail based on URL of the post

I agree with WebElaine’s comment, that storing IDs would be far more reliable, since URLs can so easily change. That said, if you have a URL like so: http://domain.com/2018/01/this-is-my-post/ You can use something like this to obtain the post name: $url=”http://domain.com/2018/05/this-is-my-post/”; $components = parse_url($url); preg_match(‘`^/\d*/\d*/(.*)/$`’, $components[‘path’], $matches); echo $matches[1]; Using the post name in $matches[1] … Read more

Categories custom-post-types Tags custom-post-types, post-meta

Add other all taxonomies as meta boxes to custom post type

As suggested by LWS-Mo this can work by using register_taxonomy_for_object_type() to register my custom post type for all taxonomies in the system and then use remove_meta_box() and add_meta_box to re-add them to the new location. I’m not sure if I really use the correct hooks – but hey, it works 🙂 One thing to mention … Read more

Categories custom-post-types Tags custom-post-types, custom-taxonomy, metabox, taxonomy

Custom Post Type / Taxonomy / Term – what template to use to avoid 404-page?

Custom Post Type / Taxonomy / Term – what template to use to avoid 404-page?

Categories custom-post-types Tags custom-post-type-archives, custom-post-types, custom-taxonomy, terms

hierarchical Custom post type child permalink not found

hierarchical Custom post type child permalink not found

Categories custom-post-types Tags custom-post-types, hierarchical, permalinks

filter rest api post by a acf filed

filter rest api post by a acf filed

Categories custom-post-types Tags custom-field, custom-post-types, filters, rest-api

How do I control what template is shown based upon Taxonomy Term?

Q1 – It seems reasonable, if it checks all of your boxes and gives you a maintenance workflow that works for you. Q2 – There are at least a few ways you could handle this, I think using rewrite endpoints is a fairly simple and workable solution. We’ll start with just a single endpoint- for … Read more

Categories custom-post-types Tags custom-post-types, template-hierarchy
Older posts
Newer posts
← Previous Page1 … Page261 Page262 Page263 … Page1,037 Next →
+ More

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
Next Page »
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress