page_link()
Note
This function replaces linkToPage().
Description
This function creates a URL that can be used in an tag. It is automatically adjusted based on the clean URLs option.
Usage
<?php echo page_link( $id ); ?>
Parameters
$id
- integer or string
- optional
The ID number or slug of the page to link to. Defaults to the current page.
Examples
Usage in blog_list.html
<a href="<?php echo page_link(); ?>"><?php echo pageName(); ?></a>
Link to a specific page
<a href="<?php echo page_link( 'page-slug' ); ?>">Take a look!</a>
-
FAQ
- What is the Page Type and how do I use it?
- How do I make blog pagination work?
- How can I make next/previous buttons to navigate my projects?
- How do I include Vimeo, YouTube, SoundCloud etc in my projects, pages, blog posts?
- How do I make excerpts for my blog posts? (Using the {more} tag)
- View all (2 more)
-
General Documentation
-
Themes
-
Code Documentation