I have a php snippet that redirect all views of the post type "robot" to the parent post type "manufacturer". There is a problem with the get_permalink() function I use in the php snippet.
Example: For the manufacturer "mir" the correct url is "hidden link" however the value returned by my snippet is "hidden link" dropping "manufacturer" from the permalink url.
Hi Nigel, thanks for the quick response. I have tried manually putting the number of the post_id instead of the $mfg_id variable. Same result. I have not tested the output of get_permalink(). I do not have much experience with debugging in WP, what is the easiest way to see the output?
That will create a debug.log file in your /wp-content/ directory which you can examine in any text editor, but only when any messages are sent to the log (e.g. errors).
You can add a line to your code to send a value like so: