To do that, you need : 1) The linked page ID (easy to find in the url when editing the page in admin) 2) the external page URL Copy and paste the code below in your functions.php add_action( ‘wp_head’, ‘my_redirection’ ); function my_redirection(){ global $wp_query; //we get the current object […]
Function: WordPress functions
99 posts
Like often in WordPress, the simpliest way to alter the core is to…dive in it and look for hooks! In the file wp-includes/default-widgets.php there is a filter hook called ‘widget_title’. That’s the one we need. It requires 3 parameters to work : the title we want to return, the instance […]
If you want to display the recent posts of the current category archive, there is a simple solution. You have to filter the query of the WordPress recent post widget. (one of the built-in widgets). The filter takes one parameter : the query arguments array. Here is the workflow : […]