I'm wondering if it is possible to write a plugin which shows nothing but only let the visitor access the feed url. The admin page should be accessible by the administrator as well.
The background of this idea is that I've written a custom feed generator and implemented it in a WordPress site. Since the site is only for the feeds, I'd like to make the site invisible to the public except the feed outputs.
I'm aware that there are Maintenance Mode and Members Only plugins. The problem is that the maintenance mode prohibits feed access and the member only mode bans general visitors.
So I'm wondering if there is a simple way to do this. I'd like to avoid editing mod_rewrite because I'm planning to make it as a plugin if possible. If it is not realistic to do it without mod_rewrite, I will try editing mod_rewrite.
Thanks for your input.
If you never want anything to render this could easily be fixed using the template_redirect hook. For example:
function stop_rendering() {
exit;
}
add_action( 'template_redirect', 'stop_rendering');
So, basically you don't want the theme to render? What about /categories, /tags, /archives etc.?
If that's all you want to do, you could just create a blank theme with the style.css (blank besides the theme info comment block) and the index.php template.
Related
In my theme there are custom page types like "team". I do not want a public access to e.g. www.xyz.com/team/ or www.xyz.com/team/xyz
In both cases it "should" return a 404 error. How can this be done manually in Wordpress without using a plugin and if not possible manually then which plugin do you recommend?
I know there are plugins which can do this but they down the speed of my website too.
Oh so this technique would be the best one to use. Great. Thanks for the help.
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.
I would like to know which WP plugin should I choose to allow every user who come to my page to add a post to my page form the frontend.
He just click on a button add a new post or something like that. Than a form appear and he inserts the title and uploads an image.
After that its published as a post.
Is there a solution like this available for WP?
Thanks in advance.
From what I know, there is no existing plugin doing it as you need. Even if it existed, I wouldn't recommend it's use for security reasons; it is hard to follow every uses and make sure visitors would post the way you want.
You are definitely better to code it by your own, and it's quite simple using the wp_insert_post function. This function will work anywhere you put it inside Wordpress (no need to build a plugin from scratch), so a simple form with validation would make it.
Hope it guides you on what you're looking for.
I'm looking to use the 'Social' plugin from MailChimp on a Wordpress blog. Everything is setup fine and it works perfectly, except one aspect.
When I use the 'Broadcast' feature or leave a comment and post to Twitter/Facebook it creates a URL with the 'Post-ID' http://domain.com/blog/?p=1 instead of using the 'postname' http://domain.com/blog/post-name/ which I setup in the permalinks section of Wordpress.
Try changing in file "/wp-content/plugins/social/lib/social/service.php" the line (appears only one time in the file)
$url = wp_get_shortlink($post->ID);
for:
$url = get_post_permalink($post->ID);
You must test carefully that the change doesn't affect any other functionality, maybe contacting to the plugin creator.
You can use the built-in filters to create plugin that will adjust the URL format, however the ?p=123 style URLs are the default (and highly recommended) to help get more meaningful content into the broadcast.
Even if you manage to match the url's and broadcast it. It still does not works.
The problem is only when you use a featured image to broadcast it.
It works better (not 100%) for a post that is broadcasted without a featured image.
The problem is only with facebook. It does a good job with twitter.
Is there a 'good working practise' way to modify the markup that a WordPress plugin produces without editing the plugin's core files. The problem I foresee is that when you update the plugin, the markup that you would have modified overwritten.
I know in Drupal there are template overrides, but I don't know enough about WordPress to do a similar practise.
Any help?
The plugin itself would probably have to be written to allow for it (though see below). There are a few ways to do this: You could have the plugin look for template files that it pulls from an arbitrary location (e.g. "uploads/myplugin") You could possibly store the HTML in the database as a setting. The plugin could be written with an apply_filter hook (just as WordPress itself uses hooks) to allow outside calls that change output (e.g. from a separate plugin or a theme's functions.php). I've used all of these methods.
If you're talking about altering the output of somebody else's plugin, you could possibly ask them to implement one of the above. Push comes to shove you can use JavaScript to manipulate the DOM.
The answer to your question is hooks and templates. If you're lucky, the plugin will use templates for its output and will check your theme to see if you've overridden them, or it may have some filter hooks that let you modify its output. If you're not so lucky, and you can't get the plugin authors to add some for you, you'll need to get more creative.
hook into the WordPress queries that the plugin is
making, and alter them to return different results.
hook into the WordPress get_option() function to change the plugin's settings on the fly.
hook into the page content, and use preg_replace() to hack the HTML.
hook in early in the page generation, call ob_start() to buffer the page output, and hook the wp_footer to call ob_end_clean() and use preg_replace() to hack the HTML.
Just some ideas :)
Obviously, it's best to work with the plugin than against it. You should check to see whether your plugin uses templates, and if it doesn't, search for calls to apply_filter() and do_action(). But sometimes, needs must!