Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to understand the concept of some <a href="http://codex.wordpress.org/Stepping_Into_Template_Tags" rel="nofollow noreferrer">Template Tags</a>, since <a href="http://codex.wordpress.org/Template_Tags/the_permalink" rel="nofollow noreferrer">the_permalink</a> fits this category. They are defined especially for use in WordPress Themes. They can be summarize as "a code that instructs WordPress to "do" or "get" something".</p> <p>Writing the_permalink simply echoes the permalink in your template. It's not something that you get in a php function and manipulates it. It just echoes the html of the information it needs to show.</p> <p>This is useful for designers working out template files in Wordpress themes: they don't need to understand a lot of programming or a lot of php keywords: they just need to know that writing "the_permalink" gives them the desired html output.</p> <p>What you're trying to do is get the output from a template tag that already outputs it's value. You need to use other template tag that RETURNS the value you want to use instead of ones that OUTPUTs it.</p> <p>In your example, you need the <a href="http://codex.wordpress.org/Template_Tags/get_permalink" rel="nofollow noreferrer">get_permalink</a>. Since the_permalink is used in the <a href="http://codex.wordpress.org/The_Loop" rel="nofollow noreferrer">Loop</a>, you need to provide a post id to your get_permalink function.</p> <p>There are another examples that fits the same problem domain: for example, I can't manipulate what wp_list_pages returns (because it automatically outputs it's result), so I need get_pages (that RETURNS an array) to manipulate it's result.</p> <p>Read Wordpress official documentation at Codex. It's great.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload