• Hi, i just explore about wordpress and planing to create a website where ;

    1. My 1st users login- they’ll go to home page and click to other page and see his content and he can edit it and can’ be see by other user.

    2nd users login- they’ll go to same homepage, and when they click to other page (same page as 1st user), and he see fresh new content and can edit it and can’t be see by other user.

    3rd user login- the same things happen.

    2.
    The other things bothering me is that how can i make a form where can be filled by all users, then the form will be saved and displayed in a table on other page. Also this applied same things like no 1 where there is many users and they can only see their own content but not others.

    Do i need to make more page for this? Or may u suggest me plugin? I still learning the coding but not so expert but if there is any codie i can use and edit may you let me know.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Pages saved with visibility => private can only be seen by the author and admins. Same for editing. You can setup the home page to show links only to pages belonging to the current user. By default, the home page lists all posts in reverse chronological order. It’s relatively simple to change this query to only show private pages by the current user through the “pre_get_posts” action.

    While it’s simplest to use the default WP backend edit screens to create or edit pages, a custom front end form could be used. You would need form handler code that assembles the form fields in a manner compatible with wp_update_post().

    Thread Starter mhidayat22

    (@mhidayat22)

    Thanks for the reply. However i still quiet not get it after spend hours on reading those things in pre get post… is that really the only way to make my users can access their own page where they can edit it and save without other users know it? Sorry i am still kinda new on this things. If there is any suggestion on plugin i may use for my question above, let me know it. For now i’ll focus on making try and error for those query things.

    • This reply was modified 6 years, 4 months ago by mhidayat22.
    Moderator bcworkz

    (@bcworkz)

    There are several ways to get specific posts, but they all require making a DB query. You could write your own SQL query, create a new WP_Query object, or alter the current query with “pre_get_posts”. Admittedly, the concept behind pre_get_posts is at first confusing, but it is often the best way to make a custom post query.

    You could try a few of the plugins in this search, but TBH it doesn’t look very promising.

    You might find starting a new WP_Query object easier to understand than altering an existing query. If nothing else, it might help in understanding “pre_get_posts”, they are both different aspects of the same thing. Code for a new query object would go on a custom page template. A WP page based on the template can be set as your “static” home page. (Displaying query results is hardly static, but that is what such pages are called in WP) By using “pre_get_posts”, you can alter the current query, so a custom template is not required.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Create private user page’ is closed to new replies.