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]
- How to get current page ID outside the loop?
- featured image as background image on pages
- Order by menu_order and title?
- How to inject custom url path for page ?
- get_page_by_title not working when used with a variable
- How to disable Page Attributes dropdown in wp-admin
- How to make certain page templates visible to admin only
- Editing Pages that Have Already Been Published
- Getting child content
- Clean URL link for page without number
- How can I have two content titles?
- Get the Page Content,without generating HTML
- How can I split long posts into pages?
- Adminbar Missing “Edit Page”
- Pass data from one page to anothe file/page in wordpress
- Get the Current Page Slug-Name
- Display child pages in a parent page? [closed]
- block a page from logged out users and redirect to homepage
- Disable ADD PDF media button on rich text editor
- invalid argument in foreach when trying to list custom post types in archive.php
- WordPress page not taking precedence over server directory
- How to properly enable comments form in page template
- How do I reference the front page’s parent Page object?
- Custom folder for wordpress page templates
- Editing Help Section
- Separate URL for a specific page
- Pages that don’t look like blog posts?
- Next and Previous Page links based on ‘Order’ attribute
- Every change made by “Author” role is going to “pending review”
- Groping Pages Per Department Option
- WordPress default theme cannot get full page on entry content div
- Create multiple custom HTML pages
- Can I link to content dynamically from a page to a new page?
- Two different layouts for the same post
- How to turn post into pages and via versa?
- Content not displaying on page
- Featured Image not displaying in a page
- Display child pages on homepage template
- Decouple page name from page title
- search page different results
- How can I change the title of the Home link in the navigation bar?
- simple category search form returns full text – but I need excerpts
- Naming custom page templates
- How can I use Page editor for two separate templates?
- Sort the data in WordPress using get-page-by-title
- Adding a filter to wp_edit_posts_query() to prevent hierarchical display of pages
- In WP, Google map error initMap is not a function [closed]
- Split Page Links
- Ask for template when adding a new page
- How to view front-end of WordPress website, using Atom?
- Custom template is not showing up in templates dropdown list after re-naming it