What you put doesn’t make much sense, as it turns a 1 step action, into a 4 step action
Why not just put:
$oferta = get_page_by_title( 'Oferta' );
$my_query = new WP_Query( array(
'post_type' => 'page',
'post_parent' => $oferta->ID
) );
Related Posts:
- How to display page title+link of page created by user
- How to get page title with the page ID?
- A check for if is parent page, if has children, if has grandchildren
- page title, parent tilte and grand parent title
- Can I display submenus in groups, using wp_list_pages?
- Require title for pages
- What is the use of $page_title and how to use it?
- Internal Links to Pages in PHP?
- Only allow new subpages to be created
- Add a Menu Link (to a WordPress Page) in the Admin Menu/Sidebar
- Page title not showing up
- Why doesnt ONE of my links in the footer work properly? [closed]
- Create subpage – filter parent pages list
- How can I automatically add child pages to pages in a WP menu?
- Relative instead of absolute links in pages?
- How get get list of pages in ajax search
- Related Links Page with moderated, user suggested link submissions
- I can’t edit my homepage – the page editor is just blank [closed]
- How do I Name a WP page in the New(ish) Block Editor?
- What is full URL for a post?
- Can I change the “Home” text in the menu?
- Page titles for internal classification of landing pages
- how can i remove page title on desktop view
- Keep page hierarchy in wp_list_pages, even if on a child or grandchild
- Displaying direct children of other pages on homepage
- anchor tag in header not working on other pages except the home page
- Multiple Loops That Pull Pages (Child/Grandchild) While Styling the First Entry
- Hide links to pages that dont have any content
- How to show page title with capitalization only as I typed in?
- Add string to page title if post in specific category
- Change displayed “page name” to distinguish multiple pages with the same title
- Search anything from a Child and Sub-Pages of their Parent page
- How do you run code on a specific page without missing the init hook?
- Show children connected to parent pages
- How to change default home link title?
- How to include a query_vars value in document_title_parts?
- How to remove the duplicate title tags and duplicate meta descriptions?
- Post Category link is same with Page link
- Add pagination to search.php page
- Access link page and not folder content of that link
- Attach link to pages accoding to tags
- 1st Level Page with No Children
- Changing title bar in browser window of theme “Encounters Lite”
- How to achieve anchor links on top of pages.
- how to list subpages in sidebar without widget
- How to remove title (home) from static page skeleton template
- one time visit to the page
- Is it possible to keep the page title from actually appearing at the top of the page?
- page title showing twice [closed]
- I want the Title of page/post to show up topmost when reading the post/page
- Add infinite scroll to content splitted post
- Check if wp-login is current page
- How to get current page ID outside the loop?
- Contact Form on WordPress Sites?
- Page returns 404 with POST variables, but not without
- Custom templates not showing up in template dropdown
- Get page id by template
- Using pre_get_posts on true pages and static front pages
- Get the content of a specific page (by ID)
- Show more than 20 items in pages or posts edit dashboard
- Allowing user to edit only certain pages
- How to display last 3 posts (recent posts) in a static page?
- How to give paged links custom title?
- How to set post slug when using wp_insert_post();?
- How can I keep the content of my pages version controlled?
- How to load javascript on custom page template?
- How to configure WordPress to handle 75,000 pages?
- How to update page status from publish to draft and draft to publish
- Check if is on child-page of a particular page
- Change page template programmatically ?
- Conditional tag to check if ‘page.php’ is being used?
- Customizing the URLs of WordPress Login and Sign-up Pages?
- Apply the_title() filter in post & page title, but not in menu title
- How to disable posts and use pages only
- featured image as background image on pages
- Check IF is a “single product page” and Check the “role” for a Redirect
- Change the_title() of a page dynamically
- How to load JS and CSS only on specific Pages using is_page()?
- Listing pages which uses specific template [duplicate]
- Proper way to get page content
- Access the same page from multiple urls (wildcard)
- Create a page without adding a page in the Database
- Is there a way to change the default page template selection?
- Can I have two child pages of different parents with the same name?
- What methods to use to create small, editable pieces of text for static pages?
- Show Default Editor on Blog Page ( Administration Panel )
- Hide page visual editor if certain template is selected?
- What is the difference between $paged and $page?
- multi page password protection
- Create a “Dummy” parent page for a hierarchy in page listing?
- How do I convert a page’s title to lower case?
- Get top level page parent title
- How to add a specific widget to only 1 page?
- Restrict admin access to certain pages for certain users
- How can I store page ID in a post instead of other selected permalink?
- How to add jQuery script to an individual page?
- WordPress page edit does not save selected template
- Add a Page without header and menus?
- What is an alternative to get_page_by_title()?
- Password protect page with multiple passwords