Home » Php » php – Get the main page where i publish post

php – Get the main page where i publish post

Posted by: admin February 25, 2020 Leave a comment

Questions:

I’m from page.php I go to the single.php category page for example site.com/view-page-where-show-post/post-in-single/ and there is the navigation “next post and previous post” and I need to make a cross to exit page.php where I switched to single.php. I tried to use this $_SERVER["HTTP_REFERER"];, but when I move to the next category, it returns the link of the last step to me, and I need to have site.com/view-page-where-show-post/ I don’t know how to leave one hole on all single.php.

I tried to use this
<a href="<?php echo get_permalink( get_field( 'close_page_return_from_referenzen' ), 'option' ) ?>">back </a> but it return me site.com/view-page-where-show-post/post-in-single/%post-in-single% but i want site.com/view-page-where-show-post/

please help me

How to&Answers:

I find the solution.
I had an error in displaying a custom field

<div class="exit-link"><a href="<?php echo get_field( 'close_page_return_from_referenzen', 'option')   ?>">back <span class="icon-close-1"><span> </span></span></a></div>