Wordpress - Plugin to differentiate post content by user role - php

My client wants to have a Wordpress site with two separate types of users in mind. For each of these personas, different post content will be displayed to the user.
Currently, I'm using Query Wrangler to separate content. However, as far as I can tell, it does not have the ability to default to one persona and keep it throughout the site. It's essentially two separate sites I'm building, but with some shared content, which is what's making this difficult.
Are there any plugins or workarounds I can use to get the functionality I need?

I use custom templates along with this plugin to control what types of content my WP users see . http://themehybrid.com/plugins/members It allows you to create custom roles and check against those roles at anytime.

Related

Re-implement users in Wordpress with custom post types and fields

I always find really difficult to work with users in Wordpress. So here's the question.
Let's say I want to use Wordpress to build a website with users and I don't want to use standard Wordpress users. I want my users, let's call them siteusers, to have multiple custom fields. I want them to have relationship with custom post types in my site.
For instance let's say I want to build a Spotify clone. I want my users to register, login, but also to create playlists, add songs to playlists, wishlists, etc. I want to have a logic behind this, and i want users to be able to download only songs they have access to.
My idea is to create a custom post type called "siteusers" and add custom fields to them and make a new frontend register/login/lostpassword/my account page/ machanism, different from the standard WP one. I would have to build an authentication method like i would on a rails application without devise.
Could it work, or are there wordpress limitations I am not seeing? Are anyone aware of any similar solution/plugin/tutorial that could save me some work?

WordPress multiple content sections

Alright I am completely lost on how to do this so I am just going to throw the question out there and hope somebody can help me in some way or another.
WordPress offers the option to create custom Taxonomies so I got the idea of pulling something out of my hat and creating a custom content section apart from the content section wordpress currently offers.
The website shown above is the only website I have been able to find which currently does this and is on a WordPress platform, as you can see they have the SoundCloud audio player pushed over to one side with the actual content placed to the other side creating that flawless look.
I guess the question here is how can I turn <?php the_content(); ?> into something completely custom pulling from a completely different form in the back end so the same information is not shared.
There are numerous ways to achieve what you want.
Shortcodes
Custom page templates
Custom meta fields to store values like the soundcloud embed url, to afterwards use it in your code.
You can always also enter HTML in the page editor, but for obvious reasons not recommended.
Custom post types allow you to define a new type of content. It will have its own section in admin where you add and edit data separate from normal Wordpress posts. It can have its own templates allowing different layouts, and you can set up custom fields so that it can store different data.
I also recommend taking a look at the Pods Framework. This plugin allows you to define custom content types very easily in the admin interface. You can set up all your fields and data types from there. All that's required then is to create the templates to make it look nice.
The nice thing about these approaches is that while the data is kept separate from standard Wordpress posts, you still have the same familiar UI, so it's easy for none-technical users to update the content.

Is it possible (and how to?) divide application to backend (admin part) and frontend (user part) parts?

I am developing web application, using zend framework 2. In my app, I want some modules. News, for example, users etc.
Is it possible, to divide whole application to two big parts: front-end (for users) and back-end (for admins).
In front-end there will be part of News module, which render news list, full news item etc.
In back-end there will be part of News module, which will render list of all news, tools for editing, deleting etc.
At the moment, I have simple structure:
I have MyZfcAdmin module, with routes configurated so, that when I am writing /admin/news/edit/5 it will call NewsController edit action with id 5 and render it. So now, I have all actions (for admins and for users) in one controller. Is it possible to create something like this:
module
frontend
News
SomeMoreModule
backend
News
SomeMoreModule
I found topic on google questions, in that suggested to use this CMS, but I want to try it by myself.
Different people have different idea in managing application, for me I will have news module that handle all news related calls both admin parts and user accessible parts. The idea you have described have some side effects like duplication of code between modules and crossing of borders between isolate modules like calling action in another modules(it's ok if there are related or fall in hierarchy), which may have issues in long term maintenance of the applications.
IMHO I might suggest you could create modules like News, users, etc where it can have combined functionality of both admin and user access. You can later include user authorization plug ins using bootstrap events and restrict action accessible by admin and other users
There is not concept of submodules inside any module. But you can give them proper naming conversations. If code is not formed in oops properly, then there can be code duplication into your project. As per #raj's answer, it's good to give restrictions based on user role. If any action is not intersecting admin and user role then you can separate those actions, but actions like add or edit news content are same for both role then you should point to same action by router.

User Authentication with WordPress

I am very new to WordPress; I usually build my sites and web apps using HTML, JQuery, and PHP. This WordPress thing has thrown me for a loop. A little background: Another company has created a new website for us and they created it as a WordPress site. I have the files and WordPress database which is all installed on our servers.
I need to build a user authentication page for users to use to login and view another page. So how do I implement user authentication with WordPress, but not give users access to the WordPress administration, and have the page for the users ensure they're logged in? All of this needs to remain with the overall theme of the WordPress website.
Firstly, when creating WordPress user, you can decide their administration level there.
You can really rein-in your users using this plugin - http://wordpress.org/plugins/user-access-manager.
Now, if i'm not mis-interpreting what you're saying, you want to serve different content to certain users. Well, my friend. Fear not, that's where plugins are handy.
1.
http://wordpress.org/plugins/user-specific-content/ (select specific users by user name, or by role name who can view a specific post content or page content)
2.
http://wordpress.org/plugins/pagerestrict/ (restrict all, none, or certain pages/posts to logged in users only)
If you're unsure how to install, activate, or use the plugin. There are an abundance of youtube & written tutorials for you to utilize. P.S. Don't neglect the wordpress documentation, it's often very informative.

Drupal site with same database for two sites - I need better solution

I am now working on a drupal project, the client needs same admin side and same database to save the content, But he needs visualize things separately. That is two sites running same code base. These two are sharing same contents. Such as news,reports etc.
What is the best way to implement this, I read some multisite doc, but its based on two admin side and different database.
Thanks in advance.
You should look into the Domain Access module. It will allow you to use a single database for a multisite setup (sharing all users and content). One of the sub modules within it Domain Theme allows you to set the active theme for each domain (making each site look different)

Categories