Limiting access to category pages in Wordpress - wordpress

I've recently installed Jason Tadlock's Members plugin which allows restriction of pages and posts but I have built a site using category pages for the majority of the pages. Could anyone tell me how to apply these restrictions to categories or to display the category template as a "page". Ideally, I'd like the links not to show up in the navigation either so that those who don't have access won't know what they are missing.
Thanks in advance.

I took a quick peek at the plugin, and it looks like although its intention was not specifically for categorical pages, you can still use its shortcode features within your category.php template to build the content how you want.
Without seeing your code, it's a little hard to give you exactly the answer you need, but this should get you started in the right direction:
<?php
$navigation = 'your_navigation_html';
$content = '[access role="editor"]'.$navigation.'[/access]';
echo do_shortcode($content);
?>
This example will hide your navigation from everyone but Editors.

Related

WordPress - How To Remove Default WYSIWYG Field That Appears On All Posts / Pages Or Change It's Order

I was wondering if it is indeed possible to remove or re-order the default WYSIWYG field that is displayed in all posts and pages within the WP admin. I mean the field that gets outputted to the page by using:
<?php the_content() ?>
Sometimes this is needed to create a more logical user experience so that stuff is edited within the admin in the same order as it appears within the actual site itself.
I know it can be argued that in some cases you can still keep the order by using this field for your first piece of content but sometimes that content is so small that it doesn't seem to make much sense.
However sometimes the first piece of content can not even utilise this area and I know some people just leave it blank but that feels untidy to me.
All time and help is greatly appreciated.
default WYSIWYG in Wordpress is TinyMCE and you can disable it with this plugin:
https://wordpress.org/plugins/tags/disable-tinymce
This plugin disables the visual editor for all users across the whole site. You could also remove the wp-includes/js/tinymce/ directory
And if you want to totally remove this from your site - delete <?php the_content() ?> from all of your templates but I do not understand why it may be necessary

How do I call a plugin in a custom page for wordpress?

So I am trying to do this and I don't know how. I have a wordpress powered website with a plugin called "frontier-post" in it. This plugin makes a new front-end post submission. The way to use it is to put the shortcode "[frontier-post]" in any post in my wordpress page and that page turns into this.
I want to make a custom page for myself, where I can have the content created by this plugin there too. So I do not want it to be a post in my wordpress, but lets say at a corner in the custom page. I have searched and found these but the suggestions there would not work. I am able to include the wordpress so that the custom page has access to posts, etc. but even using this
echo do_shortcode('[frontier-post]');
would not help me. (even if header is included)
These are the similar things i found:
Wordpress/PHP - How to use plugins outside wordpress-powered pages?
Need Help for my Custom Page Template
I would really appreciate it if you could help me with this.
If you are creating a PHP page that isn't going to be rendered inside WordPress, you can't use a Plugin of the WordPress engine to accomplish what you are wanting to build. (As the accepted answer to one of the pages you link to indicates).
Instead, you might be able to use the json-api plugin and have your custom page query it for the data. While it won't render the shortcode, it will give you the raw data to work with.
http://wordpress.org/plugins/json-api/
Edit:
Based on a comment, your do_shortcode should work...just try it without the square brackets.

How to make category templates, pages and index appear in the same menu in wordpress?

I am having some problems structuring a Wordpress Website.
Basically this website will have the following pages:
Home
Portfolio
News
Contact
The home will be designed by the index.php, that is no problem. In this page I will show some of the posts that should be in the News and some that should appear in Portfolio.
The pages Portfolio and News should present a list of posts that match this category.
Contact is a normal static page.
My idea was to create a static page for portfolio and for news and to change its theme so I get a list of posts matching this category and handle it. But I found out that this does not work as I thought because pages are not meant to this. For this reason some functions (as the_content) do not work. So I found about Category Templates, which seem exactly what I want.
But now my problem is: my menu is being built automatically and I find it nice. Using the category page template would cause me to need to build it manually, which looks like (for a newbie) a bad smell, once it can be built automatically.
Is the approach with Home->index.php, news and portfolio -> category template and contact -> static page a nice approach?
How would I build the menu in a elegant way with this approach?
Thanks!
Oscar
I don't think your approach was the best, I would have used page templates to pull the different layout/type of pages and use the front-page.php to create the homepage.
But every dev has his own way, I guess.
I think you can easily solve your problem building the menu with the built-in menu builder of wordpress. You can go in Appearance > Menu if your theme is compatible with that.
Check further documentation here
hope it helps!
cheers
In wordpress you can add static page or categories or any other pages to wordpress menu. For creating menu in wordpress see this links.
creating menu

Navigation within pages in Wordpress

Some friends of mine am starting an art blog and am aiming to use WordPress for usability reasons as their PHP/HTML/CSS experience is minimal. However, we are running into a roadblock in that we are finding it difficult to accomplish multi-level navigation within Wordpress: that is; for each WordPress 'page', there must be several 'sub-pages'. For example, each artist page (eg Zac) must have several separate sub-pages: an "About", a "Gallery" (which will be accomplished with a separate WordPress plugin) and a blog sorted by a specific category. An additional road block is presented in the form that each sub-page navigation must be separate from the main navigation: ie, not a drop-down menu, but rather a separate menu located elsewhere on the page.
I've looked around at some WordPress multi-level navigation plugins but haven't found any that adequately meet these needs. Has anyone had the same problem, and if so, how did you work around it? Is there a suitable plugin or will I need to create a separate Page template and then hand-code About/Gallery sections in separate PHP files?
Thanks!
I normally use categories to do that. What I suggest you to do is to create a category for each person and then create sub-categories, sub-pages or posts under each one.
You can then create template that will target different type of pages, you can also target some keywords.

Can't get wordpress feed to display full article

This is probably going to be a really simple fix... I just can't figure it out.
I want to display the posts from a wordpress category on the following page: http://www.oe-design.com/about-press.php?test
I've managed to do so but when I show the 'description' on the page (my code: $item->description), it only shows a snippet of the article, not the full article...
What do I need to use to show the full article?
I am trying to view the wordpress RSS feed but when I view it in FireFox it asks me to subscribe so I can't actually view it and see what I need to do to view the full article. Safari shows their own custom feed layout...
Hopefully I am making sense
Your feed doesn't have anything to do with displaying the full article or the excerpt on your category page. Change <?php the_excerpt();?> to <?php the_content();?> in your theme files, like category.pgp, single.php, etc.

Resources