Comment on WordPress Language Translation by SEO Dave.

WordPress Theme Language Translation The language date issue is why I broke the translations for the Date Meta words into individual words rather than phrases so the original English words (Posted, on, by, in) can be changed one word at a time. The German Translation (Google translation) has converted

Posted – Verfasst am

If it should be only Verfasst delete the “am” on the Language Options page.

If any of the others are wrong change them as well, if in or by etc… doesn’t work for a language add a space so nothing is shown. They are broken into single words to allow for as many formats as possible.

It’s a tricky one because there’s so many different formats for different languages, I think the current Stallion language options allows for a decent translation to most languages without too much difficulty. Also what you are seeing is version 1 of this Stallion feature, so far had no reports of it not being workable for a particular language, if it needs adapting happy to make the changes.

On the date format that’s core WordPress, Settings >> General there’s date and time formats on that page. Unfortunately I didn’t realise (until now) I’m using old code for the date and the option above has no impact, will fix this in the next Stallion update. If you must have the feature now see later about Page templates etc…

If you want to remove the “Posted in Category”, the “posted in” is within the language options, replace it with a blank space. To remove the category link you’d have to edit template files or create a template, there are category templates and post/page templates. Page templates are a core WordPress feature, this has been extended in Stallion so you have Category templates and the Page templates also work in Posts. Enable these templates under “Stallion Layouts : Custom Templates ON”. Only post type not covered is Tags and dated archives (for SEO reasons don’t use dated archives).

This is where child themes are awesome. If you want this change sitewide for posts without having to set a Page template for every Post/Page easiest way would be to copy the single.php file from /stallion-seo-theme/ folder to the child theme folder. Any files copied there basically are loaded instead of the file in the main Stallion folder.

Edit the single.php file (in your child theme) and edit the category link code, while there you can update the date code that I’ll be updating next update, this is the current (Stallion 7.1.1) code

<div class="post-date"><?php echo st_lang_posted(); ?> <?php if(st_post_dates_hide()=='1'){ ?><?php echo st_lang_on(); ?> <?php the_time('F jS, Y') ?><?php } ?> <?php if(st_author_link_hide()=='1'){ ?><?php echo st_lang_by(); ?> <a href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>"><?php the_author_meta('display_name'); ?></a> <?php } ?><?php echo st_lang_in(); ?> <?php the_category(', ') ?> <?php edit_post_link('Edit', '&#124; ', ''); ?></div>

You might even be able to figure this out yourself, the code isn’t that complicated, st_lang_posted is the language Posted word, (anything starting st_lang is Stallion language relevant), if you wanted it removed you’d delete it

<?php echo st_lang_posted(); ?>

the category link is

<?php the_category(', ') ?>

If you didn’t want the link delete the above.

The old date code is

<?php the_time('F jS, Y') ?>

the next update code will be

<?php echo esc_attr( get_the_date() ); ?>

this new code will use the Settings >> General options.

For example this would result in Posted on Date (new format) by author (if author link turned on) and the Edit link when logged in.

<div class="post-date"><?php echo st_lang_posted(); ?> <?php if(st_post_dates_hide()=='1'){ ?><?php echo st_lang_on(); ?> <?php echo esc_attr( get_the_date() ); ?><?php } ?> <?php if(st_author_link_hide()=='1'){ ?><?php echo st_lang_by(); ?> <a href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>"><?php the_author_meta('display_name'); ?></a> <?php } ?> <?php edit_post_link('Edit', '&#124; ', ''); ?></div>

If you wanted to use a Page template instead copy the page-example.php file from the main Stallion folder instead of single.php and rename it to something like page-fixeddate.php edit the file and rename the top from “Template Name: Example Default” to something like “Template Name: Fixed Date”.

Edit the file as described above.

This will add a new Page template to your Page and Post edit screens that can be selected as needed. That’s how you make a custom Page template, dead easy.

The benefit of a Page template over editing the original templates (like single.php)is why I update Stallion your single.php file will be used rather than the new single.php (assuming I’ve made changes to the file). With a Page template it will always be available without locking you out of new updates.

There’s also Category templates, same concept, but they work on categories rather than Posts and Pages, the example file for editing is category-example.php or you can copy over the category.php file to the child theme and edit the same way as editing the single.php file.

BTW single.php is for blog Posts, page.php is for static Pages, if you want the date changes on static Pages as well you’d repeat the changes in page.php.