I am using wordpress as cms for a small website and i do not have a great deal of experience with wordpress. I am trying to create a custom post type with no single.php layout.
On the homepage of design of the website, there is a ticker that displays … “Latest news” – I am able to create a custom post type, loop through it and display all news on the homepage. However this is leading to unintentional creation of links of each individual news item. Which i don’t need.
How do i get rid of it? – is there a way to have custom post type with no “permalink” URL?
i searched google for the issue and seems like only way is to just use forced url redirection. But i wanted to know if there is a better way to achieve my goal?
is there anything else other than custom post types that can be used?
If you are infact talking about linkable titles from your loop output then @JP Lew is correct. Remove the tag from the loop.
In addition:
The post type will show up on your sitemap and they will be crawled by search engines. You must use a robots.txt file and include:
to tell bots to forget about directories that do not contain content like these custom post types and wp-content areas like the plugins directory. Also within your
register_post_type()
function’s arguments the ‘public’ argument should be set to false for several related reasons including exclusion from WordPress search results, wp-admin etc.in your homepage template you will find something like this:
Just get rid of the anchor tag linking to the
the_permalink
and you should be good to go. No need to “disable” the URL, just don’t display it in your theme.