- This topic is empty.
-
AuthorPosts
-
May 7, 2013 at 12:06 pm #44612
Justin_G
MemberHi all.
My client has a blog area in their site. They have two main categories, ‘dealer blogs’ and ‘public blogs’. Ideally, we want both logged in and logged out users to be able to go to the same page and see rather a) just public blogs, or b) both public, and ‘dealer only’ blogs.
I have installed the plugin ‘user specific content’ and this seems to do what we need it to for the most part, however the plugin does NOT hide the blog completely, just shows a message saying ‘you must be logged in to view this content’. Also, the featured image still shows regardless of being logged in/out.
the link: [http://www.sunspacemodular.com/blog/](http://www.sunspacemodular.com/blog/ “http://www.sunspacemodular.com/blog/”)
If we could hide the ‘dealer’ category entirely when not logged in this would save all the hassle.
Please keep in mind that we are using a purchased theme, and would like to avoid directly changing their code. We do have access to our own custom JS, CSS, and functions files.
Thank you very much, and I apologize for the long post.
JustinMay 7, 2013 at 12:23 pm #134362TheDoc
MemberYou shouldn’t really need a plugin for this. You just need to use this:
Resource: http://codex.wordpress.org/Function_Reference/is_user_logged_in
Inside your `is_user_logged_in` conditional, you can run the loop for your dealer blogs. Just have to make sure that you also use it on the actual single pages so that logged out people can’t see the single posts, either.
So you’d do something like:
echo ‘Sorry, you need to be logged in to view this post. Log in.‘;
} ?>May 7, 2013 at 12:46 pm #134367Justin_G
Member@TheDoc, This is exactly what I would do in a normal scenario, but I don’t want to edit the themes files. I am still relatively new with custom functions, is there a way to hook into the blog page with a custom function to accomplish this?
I just don’t want my client to run an update, and my changes be overwritten.
Thanks
JustinMay 7, 2013 at 12:51 pm #134368TheDoc
MemberI’m not sure I understand, what theme are you using that you think is going to overwritten?
May 7, 2013 at 3:08 pm #134378Justin_G
MemberThe theme I am using is [http://theme-fusion.com/avada/](http://theme-fusion.com/avada/ “http://theme-fusion.com/avada/”)
My understanding of theme’s is that if you edit the core theme files and there is an update, the update will override my changed UNLESS it is in the custom_css/js/function files.
Thanks
May 7, 2013 at 3:10 pm #134379chrisburton
Participant@TheDoc isn’t talking about changing the core files but rather the theme.
Core files will be overwritten but theme files will not.
Therefore, anything inside the themes folder will not be overwritten. Hope that clears things up for you.
May 7, 2013 at 3:24 pm #134380TheDoc
MemberAlthough, you *can* get theme updates as well. I think what people normally do here is create a child theme that has all of their changes in it, but I’ve never done that before.
May 8, 2013 at 9:22 am #134439 -
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.