M
M
Mixa2015-10-28 17:23:04
PHP
Mixa, 2015-10-28 17:23:04

How to rewrite link in wordpress header without consequences?

I want to do the following: a regular post with a title, text, tags and headings and other attributes, but when you click on the title or the more tag, it opens not the original post, but a link in custom fields. This can be useful for announcing some projects "on the side" or when using a multisite build to include posts from other blogs in the hierarchy of the main site - i.e. the announcement is included in the heading on the main site, and when clicked, we go to the source site.
There are two questions.
1. How to do. I understand that you can stupidly pass the output to the condition in you if there is a link to display it, and if not, then the original link of the post, but I would like a more elegant solution at the level of the engine, not the theme.
2. Even if we replace the links in the headers and redirect the user to the right place, then physically the single-pages of such announcement posts will still exist. How to disable them so that they exist only in feeds - categories, headings, etc.? Well, there are probably more points that I didn’t take into account - the RSS addresses of the post and comments, etc.
I would be grateful for ideas.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question