Page Permalink from $id
If you know the Page $id
, use get_permalink()
:
<?php $permalink = get_permalink( $id ); ?>
Page Permalink from $slug
If you know the Page $slug
, such as /about
(including hierarchy, such as /about/work
), use get_page_by_path()
to determine the Page $id
, then use get_permalink()
.
<?php
$page_object = get_page_by_path( $slug );
$page_id = $page_object->ID;
$permalink = get_permalink( $page_id );
?>
Page Permalink from $title
If you know the Page $title
, such as “Some Random Page Name”, use get_page_by_title()
, then use get_permalink()
:
<?php
$page_object = get_page_by_title( $title );
$page_id = $page_object->ID;
$permalink = get_permalink( $page_id );
?>
Related Posts:
- How to display page title+link of page created by user
- Add a Menu Link (to a WordPress Page) in the Admin Menu/Sidebar
- Why doesnt ONE of my links in the footer work properly? [closed]
- Relative instead of absolute links in pages?
- Related Links Page with moderated, user suggested link submissions
- I can’t edit my homepage – the page editor is just blank [closed]
- Get all children titles of a page as a link to them
- anchor tag in header not working on other pages except the home page
- Hide links to pages that dont have any content
- How do you run code on a specific page without missing the init hook?
- Add pagination to search.php page
- Access link page and not folder content of that link
- Attach link to pages accoding to tags
- How to achieve anchor links on top of pages.
- one time visit to the page
- How to get current page ID outside the loop?
- featured image as background image on pages
- Can I display submenus in groups, using wp_list_pages?
- Order by menu_order and title?
- WP Page and Subdirectory with same name
- How to display list of child pages of parent page in wordpress?
- Automatically change page password
- Too many pages causes WordPress admin to be unusable
- How to display thumbnail and excerpt of a page on homepage?
- Remove pages from backend list *and* update counter accordingly
- How do i fix? WordPress database error: You have an error in your SQL syntax;
- WordPress Admin – Add Edit link to specific page under Pages Menu
- Show child pages and sibling pages on the child page
- How do I use featured images on index.php?
- Making a wordpress page the index on the site?
- Problem With Pages Displaying
- Removing the TinyMCE editor for a given page template
- Using Pages to handle calls for custom post types
- Displaying Subpages while on Parent page?
- Guest authors, sort of like Wikipedia, but more theme-able
- Missing Pages (Drafts?)
- WordPress redirects me to posts page after editing one page
- Getting to a specific page on website using specific code instead of navigation bar
- Pages views limit [closed]
- Redirect to page list when page published
- Get the url of a page template without using the page slug and ID
- Having wordpress page accesss issue under sub-directory
- Add external css to Contact Page
- Role can edit just one page [closed]
- Suddenly forbidden 403 error on some pages
- how to edit source code of specific page in wordpress?
- How to select a specific page
- Cannot enter “::before” for li tag when editing a WordPress page
- cannot link a external url, present page url acting as parent url
- How to get page_id for url rewrite or how to use page slug for calling a page?
- JQuery Plugins in WordPress
- how can i remove page title on desktop view
- Is there a way to schedule changes to a page?
- How do I edit text displayed on my browser tab?
- Option for pages order in backend
- Return subpages of an author if the parent page was published by an other author
- Page menu not showing in admin, new Page button missing in toolbar too
- Keep page hierarchy in wp_list_pages, even if on a child or grandchild
- Order by modified date working in POSTS but not PAGES
- Allow a user to edit their own page and profile only
- WordPress Page doesn’t load the template selected
- Custom folder for wordpress page templates
- Editing Help Section
- Separate URL for a specific page
- Pages that don’t look like blog posts?
- Can I use Pages like a Wiki
- list child-pages as normal pages?
- Next and Previous Page links based on ‘Order’ attribute
- Create multiple pages with tables from json file
- Attaching a file to a page without adding to media library?
- Every change made by “Author” role is going to “pending review”
- Groping Pages Per Department Option
- Requiring a Visitor to Enter a Password Each Time They visit a Page
- 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?
- How to remove the duplicate title tags and duplicate meta descriptions?
- Two different layouts for the same post
- My page title turns into a h2 tag – What to do?
- problem with loading pages
- How to turn post into pages and via versa?
- Content not displaying on page
- Blank white space where header was [closed]
- Featured Image not displaying in a page
- Display child pages on homepage template
- Set order acs and no paging for archive page
- Pageview all of sudden not working
- Childpage title + content on Parent Page
- search page different results
- 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?
- Can’t create new pages in wordpress
- Custom template is not showing up in templates dropdown list after re-naming it