Skip to main content
Tweeted twitter.com/#!/StackWordPress/status/429245818466746369
added 28 characters in body
Source Link
kaiser
  • 50.8k
  • 27
  • 150
  • 244

I am working on a site where I am using a plugin called Favorite Posts so logged-in users can add a post (a custom post type) to their favorites.

I created a page called my-favoritesmy-favorites which allows the logged-in user to see the posts he has favorited.

Now I need to create a page which allows the another user or visitor to check this user's favorites.

So I need to be able to do three things:

  1. getGet a function related to author that returns a link like mydomain.com/user/usernameexample.com/user/username which I can append to /favorites to get the link  - mydomain.com/user/username/favorites (the_author_linkexample.com/user/username/favorites ()the_author_link() and get_the_author()get_the_author() link seems to link to the website and the_author_posts_urlthe_author_posts_url() outputs the a tag with the name. any function to just get the url or maybe modify author to show user instead?)

  2. get wordpressGet WordPress to use a template called favorites.phpfavorites.php to display this page. (ifIf the structure matches, then how do iI tell wordpressWordPress which template toto use?)

  3. getGet the user id of the user in order to show his/her favorites to the visitor. rightRight now i, I use the [favorite-post][favorite-post] shortcode in my template file and can pass a parameter called [favorite-post user_id = ""].

    [favorite-post user_id = ""]
    

    Will it automatically get the user id if the page is branched out from /author  ?

I found this article but it still deals with custom post types and query_varsquery_vars which I am not using. How do I make it work for the favorites page? Most other similar questions asked here were solved using a slug for the custom post type or taxonomy.

I am working on a site where I am using a plugin called Favorite Posts so logged-in users can add a post (a custom post type) to their favorites.

I created a page called my-favorites which allows the logged-in user to see the posts he has favorited.

Now I need to create a page which allows the another user or visitor to check this user's favorites.

So I need to be able to do three things:

  1. get a function related to author that returns a link like mydomain.com/user/username which I can append to /favorites to get the link- mydomain.com/user/username/favorites (the_author_link() and get_the_author() link seems to link to the website and the_author_posts_url outputs the a tag with the name. any function to just get the url or maybe modify author to show user instead?)

  2. get wordpress to use a template called favorites.php to display this page. (if the structure matches then how do i tell wordpress which template to use?)

  3. get the user id of the user in order to show his/her favorites to the visitor. right now i use the [favorite-post] shortcode in my template file and can pass a parameter called [favorite-post user_id = ""]. Will it automatically get the user id if the page is branched out from /author  ?

I found this article but it still deals with custom post types and query_vars which I am not using. How do I make it work for the favorites page? Most other similar questions asked here were solved using a slug for the custom post type or taxonomy.

I am working on a site where I am using a plugin called Favorite Posts so logged-in users can add a post (a custom post type) to their favorites.

I created a page called my-favorites which allows the logged-in user to see the posts he has favorited.

Now I need to create a page which allows the another user or visitor to check this user's favorites.

So I need to be able to do three things:

  1. Get a function related to author that returns a link like example.com/user/username which I can append to /favorites to get the link  - example.com/user/username/favorites (the_author_link() and get_the_author() link seems to link to the website and the_author_posts_url() outputs the a tag with the name. any function to just get the url or maybe modify author to show user instead?)

  2. Get WordPress to use a template called favorites.php to display this page. (If the structure matches, then how do I tell WordPress which template to use?)

  3. Get the user id of the user in order to show his/her favorites to the visitor. Right now, I use the [favorite-post] shortcode in my template file and can pass a parameter called

    [favorite-post user_id = ""]
    

    Will it automatically get the user id if the page is branched out from /author?

I found this article but it still deals with custom post types and query_vars which I am not using. How do I make it work for the favorites page? Most other similar questions asked here were solved using a slug for the custom post type or taxonomy.

added 273 characters in body
Source Link

I am working on a site where I am using a plugin called Favorite Posts so logged-in users can add a post (a custom post type) to their favorites.

I created a page called my-favorites which allows the logged-in user to see the posts he has favorited.

Now I need to create a page which allows the another user or visitor to check this user's favorites.

So I need to be able to do three things:

  1. get a function related to author that returns a link like mydomain.com/user/username which I can append to /favorites to get the link- mydomain.com/user/username/favorites (the_author_link() and get_the_author() link seems to link to the website and the_author_posts_url outputs the a tag with the name. any function to just get the url or maybe modify author to show user instead?)

  2. get wordpress to use a template called favorites.php to display this page. (if the structure matches then how do i tell wordpress which template to use?)

  3. get the user id of the user in order to show his/her favorites to the visitor. right now i use the [favorite-post] shortcode in my template file and can pass a parameter called [favorite-post user_id = ""]. Will it automatically get the user id if the page is branched out from /author ?

I found this article but it still deals with custom post types and query_vars which I am not using. How do I make it work for the favorites page? Most other similar questions asked here were solved using a slug for the custom post type or taxonomy.

I am working on a site where I am using a plugin called Favorite Posts so logged-in users can add a post (a custom post type) to their favorites.

I created a page called my-favorites which allows the logged-in user to see the posts he has favorited.

Now I need to create a page which allows the another user or visitor to check this user's favorites.

So I need to do three things:

  1. get a function related to author that returns a link like mydomain.com/user/username which I can append to /favorites to get the link- mydomain.com/user/username/favorites

  2. get wordpress to use a template called favorites.php to display this page.

  3. get the user id of the user in order to show his/her favorites to the visitor. right now i use the [favorite-post] shortcode in my template file and can pass a parameter called [favorite-post user_id = ""]

I found this article but it still deals with custom post types and query_vars which I am not using. How do I make it work for the favorites page? Most other similar questions asked here were solved using a slug for the custom post type or taxonomy.

I am working on a site where I am using a plugin called Favorite Posts so logged-in users can add a post (a custom post type) to their favorites.

I created a page called my-favorites which allows the logged-in user to see the posts he has favorited.

Now I need to create a page which allows the another user or visitor to check this user's favorites.

So I need to be able to do three things:

  1. get a function related to author that returns a link like mydomain.com/user/username which I can append to /favorites to get the link- mydomain.com/user/username/favorites (the_author_link() and get_the_author() link seems to link to the website and the_author_posts_url outputs the a tag with the name. any function to just get the url or maybe modify author to show user instead?)

  2. get wordpress to use a template called favorites.php to display this page. (if the structure matches then how do i tell wordpress which template to use?)

  3. get the user id of the user in order to show his/her favorites to the visitor. right now i use the [favorite-post] shortcode in my template file and can pass a parameter called [favorite-post user_id = ""]. Will it automatically get the user id if the page is branched out from /author ?

I found this article but it still deals with custom post types and query_vars which I am not using. How do I make it work for the favorites page? Most other similar questions asked here were solved using a slug for the custom post type or taxonomy.

added 273 characters in body
Source Link

I am working on a site where I am using a plugin called Favorite Posts so logged-in users can add a post (a custom post type) to their favorites.

I created a page called my-favorites which allows the logged-in user to see the posts he has favorited.

Now I need to create a page which allows the another user or visitor to check this user's favorites.

So I need to do three things:

  1. get a function related to author that returns a link like mydomain.com/user/username which I can append to /favorites to get the link- mydomain.com/user/username/favorites

  2. get wordpress to use a template called favorites.php to display this page.

  3. get the user id of the user in order to show his/her favorites to the visitor. right now i use the [favorite-post] shortcode in my template file and can pass a parameter called [favorite-post user_id = ""]

Any related resources/code appreciatedI found this article but it still deals with custom post types and query_vars which I am not using. How do I just can't seem to understand where to startmake it work for the favorites page? Most other similar questions asked here were solved using a slug for the custom post type or taxonomy.

I am working on a site where I am using a plugin called Favorite Posts so logged-in users can add a post (a custom post type) to their favorites.

I created a page called my-favorites which allows the logged-in user to see the posts he has favorited.

Now I need to create a page which allows the another user or visitor to check this user's favorites.

So I need to do three things:

  1. get a function related to author that returns a link like mydomain.com/user/username which I can append to /favorites to get the link- mydomain.com/user/username/favorites

  2. get wordpress to use a template called favorites.php to display this page.

  3. get the user id of the user in order to show his/her favorites to the visitor. right now i use the [favorite-post] shortcode in my template file and can pass a parameter called [favorite-post user_id = ""]

Any related resources/code appreciated. I just can't seem to understand where to start.

I am working on a site where I am using a plugin called Favorite Posts so logged-in users can add a post (a custom post type) to their favorites.

I created a page called my-favorites which allows the logged-in user to see the posts he has favorited.

Now I need to create a page which allows the another user or visitor to check this user's favorites.

So I need to do three things:

  1. get a function related to author that returns a link like mydomain.com/user/username which I can append to /favorites to get the link- mydomain.com/user/username/favorites

  2. get wordpress to use a template called favorites.php to display this page.

  3. get the user id of the user in order to show his/her favorites to the visitor. right now i use the [favorite-post] shortcode in my template file and can pass a parameter called [favorite-post user_id = ""]

I found this article but it still deals with custom post types and query_vars which I am not using. How do I make it work for the favorites page? Most other similar questions asked here were solved using a slug for the custom post type or taxonomy.

Source Link
Loading