New answers tagged

0 votes

Get the Current Page Number

$page = max( 1, get_query_var( 'paged' ) );
wp-mario.ru's user avatar
1 vote

Search page doesn't recognise post_type=page

I found a solution in this answer here: https://stackoverflow.com/questions/63678063/wordpress-search-filtering-pages-and-posts I customised the function as follows: function page_search_filter( \...
evilscary's user avatar
  • 111
0 votes

Show only top 3 posts from 3 categories in order on home page

define an array $categories where each key is a category slug and its corresponding value is the order in which you want to display the categories on the front page. Replace category-2-slug and ...
vijay pancholi's user avatar
1 vote

Get page id by title?

Function get_page_by_title() is deprecated. Use WP_Query instead or try something like this: /** * Retrieves a link to a page object based on page title * @param $title string Page title ...
Mode Martinez's user avatar

Top 50 recent answers are included