Wordpress, Setting language for each post? - wordpress

I have a blog and I want to write some posts in spanish and some other in english (no post will be in both languages).
So, I want to be able change the value returned by language_attributes() function for certain posts. I've seen that language_attributes() uses get_bloginfo('language'). So I guess in wordpress, language is designed to be at 'the whole site' level rather than at 'post' or 'page' level.
I think I only have two solutions: to write a plugin in which I can define the language for each post (which would have to use a filter like here. Or to use a multi-language plugin, which is a too sophisticated solution for my simple problem.
Any other ideas? Any other plugin o simple solution?
thanks

There are plug-ins already available for setting up a multilingual WordPress blog. You might want to have a look into this topic: http://codex.wordpress.org/Multilingual_WordPress. So, you could use an existing plug-in.

Related

how can i create archives for custom post type

the WordPress framework allows to build different archive templates for each of your custom post type by e.g:
archive-event.php
taxonomy-event_category.php
is it possible to create author and date archive for custom post type by doing the following:
author-event.php
date-event.php
if this is not possible, can anyone advise how i can go about achieving this?
I think these links will help answer your question and get you started:
http://codex.wordpress.org/Template_Hierarchy
http://codex.wordpress.org/Category_Templates
The gist of it is that you can in fact make an author-event.php however date-event.php does not get checked because the template hierarchy dictates that it uses date.php, archive.php, or index.php.
One solution is to use conditional tags such as is_author() or is_date(). If you do, keep in mind that you'll have to have a common archive.php and decide which template you really want to use by using conditional tags.

wp email publishing with custom content type?

having researched wp forums and only found people asking this question without any answers, I resort to the source of all truth (stack overflow).
I use wordpress custom post types (Custom Post Type UI plugin) and find it very handy.
Now, I want to be able to email-publish some content via WPs built-in email publishing system, but by default that is set up to only publish as regular posts.
I am aware that I can choose categories for the emailed content, but I would very much like to keep all the pages and content of my news (=blogposts) feeds the way they are, being able to put the email-published content into a content type of its own would really help me out.
So I wonder if anyone has done that, and how you would go about it. Thanks for any input.
Not sure if this helps people looking for a solution, but I managed to do it like this...
When a post is submitted for publish by WordPress default email2post, there is an action hook named 'publish_phone' running, so you can get the post there and change its type like this:
add_action('publish_phone','custom_type_by_mail');
function custom_type_by_mail($post_id){
$p = get_post($post_id,'ARRAY_A');
$p['post_type'] = "my-custom-type";
wp_update_post($p);
}
I resorted to converting it into a post category instead of its own content type. I know not whether there be any other solution =)

Wordpress Functionality: Custom Theme or Plugin?

I am new to Wordpress (using roughly 6 months) and just now getting into development when I decided I would attempt to replicate a project I have going currently and after reading multiple blogs regarding plugin development and custom post types, I am thoroughly confused as to which direction I should go. I am in need of creating a site that has back-end management (admin only) and then end-user management where the end-user should have a page that allows them to manage their items.
With custom post types, I am able to create the objects that I will need to use but that doesn't give me total control when it comes to allowing the end-user to modify them from a front-end interface.
With a plugin, I think I am able to create exactly what I need but not sure how to yet but at the same time, thinking through the structure of Wordpress, everything is basically a post, correct? So, if that's the case, my plugin would need to have the ability to register new custom post types. Does it sound like I am on the right track or am I way off here?
Custom Post Types can add a lot of power, especially if you dress up the Custom Fields with meta boxes. You can always use a role-scoping plugin to limit the access of end-users to only be able to use these Custom Posts and nothing else. CPT are a great way to handle inventory management and not rely on a plugin that will either cost $ or potentially break months down the road.
That said, many plugin you would find would most likely just create a Custom Post Type anyway. Take a look around on the codex for info on creating CPT, and if you're interested, look at jaredatch's work on Github.
http://codex.wordpress.org/Post_Types
https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress

Custom Post Type Templates In Wordpress

I don't suppose anyone is aware of whether custom post types can have custom templates just like posts in WP? I've found no documentation on this on the codex and can't really find any relevant material. I'd have assumed WP 3.1 supports this but there's no mention to it. It seems like a black hole that someone must know about?
Apologies for the very generic, open-ended question. I know about custom post types and have implemented them, it's just this seems undocumented.
What do you mean by "templates"? Are you using the term in the same way WP defines it? If so, they seem to be supported: http://codex.wordpress.org/Post_Types#Custom_Types
In the form of the
single-type-template. In the same way
that posts are shown on their own page
with single.php, custom post types
will use single-{posttype}.php if it's
available.

How to add one more editor for pages /post in wordpress

Hello Friends I want to add one more editor for wordpress pages/post .Is there is any plugin or any thing .Please let me know if any one having any idea about this.I shall be very thank ful to you
Do you mean you want to use a different editor for posts/pages than the built in one? I haven't tried this one but it looks good and I've been meaning to try it:
http://www.deanlee.cn/wordpress/fckeditor-for-wordpress-plugin/
If you are looking for multiple VISUAL/HTML editors (to control different parts of your post/page), you can either use custom fields or a plugin called PODS CMS.
If you are using custom fields, read:
codex.wordpress.org/Custom_Fields
A very popular plugin that works with custom fields is FLUTTER. I haven't used it myself, but I have used other plugins and I would probably go with Flutter because of what I have heard about it.
If you use PODS CMS, be aware that it doesn't work with plugins that require custom fields (for example, many feature slider plugins) but it's a great way to have multiple text fields on the same page. It's great for very customized content.
PODS CMS does require some php knowledge but the documentation online is very good:
mondaybynoon.com/2010/01/04/introduction-to-pods-cms-wordpress/
Personally, if I have more than one custom field per post/page, I would go with PODS, but that is just my preference.
I got the solution of above question.
http://wordpress.org/extend/plugins/multiple-content-blocks/
Using this you can easily add one more editor for page or posts
Thanks

Resources