Translate "Read More" in posts.

November 2012 WordPress Theme
GK User
Sat Feb 09, 2013 9:55 pm
I'm trying to find the correct language file to translate the "Read More" button in the posts.
I'm using nl_NL.mo and nl_NL.po in wp_content/languages and also in wp_content/themes/Publisher/languages (created from the theme's POT file).

Unfortunately I cannot seem to find the "Read More" element.

What am I missing ?

Thank you.
User avatar
Fresh Boarder

GK User
Sun Feb 10, 2013 5:43 pm
Hi,

As I see the package contains wrong *.pot file - please use the attached one - we will add it also in the nearest update of this theme.
User avatar
Administrator

GK User
Sun Feb 10, 2013 6:17 pm
Hi Dziudek,

Thank you very much. Yes, the translations work fine now.

Unfortunately, I'm experiencing some more issues with your Publisher theme.

I am trying to change the date format under the posts titles. It should be something like 10 february 2013 but it shows like february 10, 2013.
I did change the date format in my WP general settings to j F Y but it does not change on the posts.
It shows correctly when I change to the standard WP themes like Twenty Eleven so it must be somewhere in the template itself.

Then I tried to find the code in the template files but could not find any at all.

I am also trying to remove the author under the post title but there also seems to exist no simple way.

Am I missing something ?
User avatar
Fresh Boarder

GK User
Mon Feb 11, 2013 11:41 am
To change the date format please open file wp-content/themes/Publisher/gavern/helpers/helpers.layout.fragments.php and find line:

Code: Select all
<li>
   <time class="entry-date" datetime="<?php echo esc_attr(get_the_date('c')); ?>">
       <?php echo esc_html(get_the_date('F d, Y')); ?>
   </time>
</li>


You have to change the "F d, Y" to your own value.

I'll also add an option to change it automatically to our ToDo.

If you want to disable post author, please just open the theme Basic settings and there is an option "Display Author Info".
User avatar
Administrator

GK User
Mon Feb 11, 2013 12:09 pm
Great, I would never have found that file. Thank you for pointing this out. It should indeed be an option in the backend.

The author info block is disabled in the basic settings but it does not work. The author is still shown.

Another thing is the Read More button. It appears under every post, even if there is nothing more to read. If I am not mistaken Wordpress normally needs the <!--more--> element to know whether the button should appear or not. So I would prefer to choose by myself when and where the button should appear. Now, it looks a bit silly that there is a Read More under a post while there is nothing more to read. It seems to appear automatically.
Is this a specific theme behaviour and is there a way around this ?

Thanks again.
User avatar
Fresh Boarder

GK User
Mon Feb 11, 2013 4:00 pm
Are you sure that you have disabled option "Display Author Info" not "Display Author Info on pages"? Because I've tested this option now and it is working fine on the post page.

The readmore buttons are displayed under every post on the category/archive/author etc. pages. If you don't like this behaviour the you will have to remove line:
Code: Select all
<a href="<?php echo get_permalink(get_the_ID()); ?>" class="btn"><?php _e('Read more', GKTPLNAME); ?></a>


from all content-*.php files and probably override the excerpt with hooks to generate the read more button by yourself.
User avatar
Administrator

GK User
Mon Feb 11, 2013 6:02 pm
Yes, both options are disabled. The author keeps showing up.

Thanks for the Read More issues. I found a solution for my case.
User avatar
Fresh Boarder

GK User
Mon Feb 11, 2013 7:55 pm
In this strange case I recommend to open layouts/content.post.footer.php file and change lines:

Code: Select all
<?php if($social_api_output != '' || gk_author(false, true)): ?>
<footer>
   <?php echo $social_api_output; ?>
   <?php gk_author(); ?>
</footer>
<?php endif; ?>


to:

Code: Select all
<?php if($social_api_output != '' || gk_author(false, true)): ?>
<footer>
   <?php echo $social_api_output; ?>
</footer>
<?php endif; ?>
User avatar
Administrator

GK User
Mon Feb 11, 2013 8:49 pm
Well, unfortunately that didn't help either.
To be sure that we are talking about the same thing I included a screenshot of the author position. It is in Dutch but this should not be a problem (Author = Auteur) :)

I found out how to remove it but I would prefer a more simple method instead of hacking the code itself...

In helpers.layout.fragments.php I just removed the following line :

Code: Select all
<li><?php _e('Author:', GKTPLNAME); ?>
<a class="url fn n" href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>" title="<?php echo esc_attr(sprintf(__('View all posts by %s', GKTPLNAME), get_the_author())); ?>" rel="author"><?php echo get_the_author(); ?></a></li>
User avatar
Fresh Boarder

GK User
Tue Feb 12, 2013 9:38 am
Sorry - I thought that you're talking about author block under the post :) Currently there is no option to hide it - the only way is removing it from the fragment which you have mentioned.
User avatar
Administrator

GK User
Fri Oct 18, 2013 7:45 pm
I'm trying to translate "read more" too....but translating Publisher.pot doesn't seems to work. I'm using a child-theme so I copied languages/Publisher.pot to my subtheme, is that ok?

Code: Select all
msgid   "Read more"
msgstr  "Llegir més"
User avatar
Senior Boarder

GK User
Sun Oct 20, 2013 9:49 am
Hi,

The *.pot file is only a base for creating the language files - you should create a *.po and *.mo files from the *.pot file and name it using your language code i.e. "en_US.po" and "en_US.mo".
User avatar
Administrator

GK User
Mon Oct 21, 2013 4:10 pm
Well, I created .po and .mo files from Publisher theme .pot file, edited the .po file to change the "read more" text but nothing happens. I also edited wp-config.php to define:

Code: Select all
define ('WPLANG', 'ca_ES');


So I have ca_ES.po and ca_ES.mo in my Publisher-child/languages directory, but "read more" still shows up in English.
User avatar
Senior Boarder

GK User
Tue Oct 22, 2013 10:13 pm
Please try to override the functions.php file and replace line:

Code: Select all
load_theme_textdomain( $template_name, get_template_directory() . '/languages' );


with:

Code: Select all
load_theme_textdomain( $template_name, get_stylesheet_directory() . '/languages' );
User avatar
Administrator

GK User
Wed Oct 23, 2013 6:06 pm
Copied functions.php into publisher-child folder, replaced the line you said and when I activate again the child-theme it gave me and error:

Code: Select all
 Fatal error: Cannot redeclare gavern_theme_setup() (previously declared in C:\wamp\www\wordpress\wp-content\themes\Publisher-child\functions.php:119) in C:\wamp\www\wordpress\wp-content\themes\Publisher\functions.php on line 160


Anyway, by mistake I opened another topic asking for the same thing, sorry, :oops: and Piotr is helping me there so it would be better to follow that topic, isn't it?
User avatar
Senior Boarder

GK User
Thu Oct 24, 2013 8:14 am
OK ;)
User avatar
Administrator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.