Forum Replies Created
-
AuthorPosts
-
indalabPost count: 17
Thanks, I figured it out.
I used this:
add_rewrite_rule("([^/]+)/?",'index.php?pagename=$matches[1]', 'top');
Now I can access any page via the page base or without the page base, and also able to use the ‘author without the base’ on your plugin with pagination working.
indalabPost count: 17Yes, that was the first thing I tried and seems to work, you are able to go to the author page (eg. my-site/username), customize it, ect…, but for some reason it doesn’t allow for me to get more posts, pagination from the author. And this is where I find that my-site/author-username/ and my-site/author/author-username/ is different. If not using the HMWP plugin then my-site/author/author-username/ will work with pagination, but then I notice my-site/author-username/ does not work with pagination. If I was to activate the HMWP plugin and enable the setting to remove author base,”Author without base”, then everything works fine and able to get pagination with only my-site/author-username/. I know it sounds confusing, but having just /%author%/%postname%/ using HMWP does not work, I need to enable the ”Author without base” so that it can work. I even tried replace HTML to remove new_authorbase but that doesn’t seem to work when getting new posts, the pagination does not work. For example, my-site/author-username/page/2. But if I check on “Author without base” on the plugin then everything works.The only thing is that I need to add a Page Base if I was to use “Author without base”. I like the way it’s being used with the setting enabled “Author without base”, i just need to start using a short page base such as my-site/p/termspage (I mean, Youtube uses a page base ” yt “, so I guess it’s not that bad to use) but if there’s a way to get both working (pages and author) without a base, it will be great to know how.
indalabPost count: 17I tried different methods and wasn’t able to. Having author and page in blank will work but not the same as having ‘Author without base’ checked. The reason I say this is because I’m using a infinite scroll inside author page, and with ‘Author without base’ checked I can then scroll to other pages inside the author page. But without it, I can still visit http://mysite/AUTHOR-USERNAME (using %author%/%postname%) but it won’t retrieve the posts. Now if I visit http://mysite/author/AUTHOR-USERNAME then it work.
I tried functions such as:
function new_author_base() { global $wp_rewrite; $wp_rewrite->author_base = ''; $wp_rewrite->author_structure = '/%author%'; // $wp_rewrite->page_structure = ''; //$wp_rewrite->page_structure = '/%pagename%'; } add_action('init', 'new_author_base');
But then other Pages created does not work, only the author page, home, posts, ect…
It’s probably better using a page base after all…
- This reply was modified 11 years, 1 month ago by indalab.
indalabPost count: 17By the way, I use a plugin to reserve nice names in which I also use to add pages already created, this way users are not able to create a username with the same page name or pages I might use in the future such as: ‘settings’, ‘profile’, ‘support’, ect…
-
AuthorPosts