Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
A permanent link to an item (a blog post, an attachment, ...). The default structure is "?p=123", but WordPress can handle "pretty permalinks" and will rewrite them internally to the former version. If you have a question about special rewrite structures you should use the [url-rewriting] tag.
27
votes
Accepted
Custom post type permalink endpoint
A couple things. First, your function names need to be prefixed with something unique. WordPress is a big ecosystem, and someone else has probably used all the generic function names you can think o …
1
vote
Menu Link Redirect Based on Username or User ID
I think you can make this much easier than you are. Just create a my-projects page and forget about the custom rewrite. Why? Because a user will only need to see their own projects. No need for a just …
16
votes
How to custom change author base without $this->front?
'/%author%';
}
After that's in place, just re-save permalinks.
Here's a plugin to put an option on your permalinks page to do this. …
3
votes
Accepted
Different permalink for posts and authors
I would just change the author_base on the global $wp_rewrite object. Also add a field to the Permalink options page, so you can change it at will.
To start: a class to wrap everything up.
<?php
cla …
1
vote
Accepted
Multiple Tags Issue in Permalinks
wpse72703_modify_tags', 100);
function wpse72703_modify_tags()
{
global $wp_taxonomies;
$wp_taxonomies['post_tag']->sort = true;
}
The only thing you'll need to do differently in the using tags in permalinks …
2
votes
Archive permalinks
Just be sure to flush your rewrite rules: visit Settings > Permalinks and hit save. … The totally awesome, but a little bit complex way: Add a field to the permalinks options page where you can specify the date base.
A class to wrap things up in.
<? …
3
votes
add_query_vars and canonical links
WordPress thinks you're on those pages because of the pagename query var in your rewrite rules.
Your journey is going to start in wp-includes/default-filters.php, which every WP developer should know …
1
vote
get_permalink() always returns empty
First off, you should use get_posts instead of a raw SQL query. Or at least use $wpdb.
<?php
$posts = get_posts(
array(
'post_status' => 'publish'
'numberposts' => -1
)
);
…
9
votes
Category archive by year with permalink support /category/YYYY
What you're looking for is an endpoint. There are already several of these built in: /feed/some-feed/ for feeds or /trackback/ on posts. Those are both endpoints.
Fortunately, WordPress provides a …
2
votes
Accepted
Post will not load via ajax
All ajax requests should be routed through the handy /wp-admin/admin-ajax.php file.
It works with the great WP hooks system. So you send an "action" with your request and use that as part of the act …
5
votes
Accepted
How do I customize my WordPress shortlink structure in link-template.php without a plugin?
Okay, so, as mentioned in my comment to you: altering core files is not a good idea. But here is a plugin solution.
First we're going to create our own rewrite rules that rewrite s/123 (replace 123 …
2
votes
Accepted
Link to Particular Page Within Template PHP Code
You probably want to use get_permalink and get_the_title. Example:
<a href="<?php echo get_permalink( YOUR POST ID ); ?>"><?php echo get_the_title( YOUR POST ID ); ?></a>
Replace YOUR POST ID with …