Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Boris Kamp16,660 Points
post content loading dependent on user ID
I've created a contact database using Filemaker but and would like show this data on a Wordpress website. Im gonna export filemaker to Excel and will import the Excel file into the Wordpress TablePress plugin. That way I will have about 50 tables with unique ID's, each table represents a contact. Next, Each contact will get an user login to login to WP. Now Im thinking of linking the tables to the user ID's by naming the tables the same as the user ID or something?
But how can I create a post that will only be visible to the one user it is meant for? I want to create a login button in the navigation bar, when the user clicks it, some php code must make sure it will load a custom post template and echo the user ID in the shortcode to display the table.
I have no idea if this is the best solution, unfortunately I have no experience with this. It would be great if anybody could give me some tips on how he/she would achieve this.
jeff creamer23,733 Points
Although there is probably an elegant PHP solution to this or by tweaking the TablePress plugin (which I haven't used yet), one temporary fix might be to make each table Password-protected and having each user's site login password also be the password to view their individual table. If tables are placed into a Post or Page format, enabling Password protection is a snap from the dashboard.
There might be some more workarounds suggested in the plugin's support forums: