Is this from a plugin or theme? What theme or plugin. Can you supply a url to your site? Please provide more information.
Thread Starter
Alkorr
(@alkorr)
Hi mrtom414, no plugin, nothing, only a genuine WP install 🙂
When you write a post (not using Gutenberg) you can select some text and click on the Insert/Edit Link icon above the text area. If you click on the Link Option gear icon (right) then a list appears with recent published posts you can add as link. I want to exclude recent published pages to appear in this list. There must be some code to add to the functions.php but I don’t know where to start (I don’t code at all…).
I hope it helps, thanks!
Thread Starter
Alkorr
(@alkorr)
Hi, I found this code to exclude pages from WordPress Search, I guess it could work to exclude Pages from the Insert/Edit Link dropdown menu but that’s as far as I can go since I don’t code at all… If this is useful to anyone to help me on that matter. Thank you!
if (!is_admin()) {
function nopages_search_filter($query) {
if ($query->is_search) {
$query->set('post_type', 'post');
}
return $query;
}
add_filter('pre_get_posts','nopages_search_filter');
}
Thread Starter
Alkorr
(@alkorr)
I’m sorry to post again but I thought maybe the code I copied in my previous post would help someone find a solution to my problem.
I searched again through the WP Forums and the web but I couldn’t find any suggestion to solve my problem. I hope someone will read this thread and think of something <:)
Thanks!