Problem post
-
Hello,
I do not understand why the articles I create my site with the theme vantage, do not reveal the date of the article and the author.
Can you help me ?
-
Hi @pissenlit
Thanks for reaching out.
Go to Appearance > Theme Settings and ensure Post Metadata is enabled. Also, check that Post Date and Post Author are enabled.
Hope that helps ??
Hi Misplon
Awesome it works !! Now where do I change the text : Posted on : to put it in French ?
Thank you a lot ??
Sure, glad to hear you’ve made progress.
The easiest way to change that string would be to use a plugin to translate the theme or just that string in the theme. Give this plugin a try:
Hi Misplon
I try not to install too plugin … and impossible to find in files which change the text !
Need help, thank you !!Keep in mind that all www.remarpro.com themes completely overwrite their own folder during theme update so it’s not possible to safely make edits to theme files.
Loco Translate really is the easiest way to accomplish this task. The alternative is to use a child theme and POEditor app to translate Vantage.
Here is a starter child theme you can use:
https://siteorigin.com/wp-content/uploads/2015/03/vantage-child-starter.zipHere is where you can download POEditor:
https://poeditor.com/Here is a tutorial on how to translate the theme:
https://premium.wpmudev.org/blog/how-to-translate-a-wordpress-theme/You’ll find the Vantage .pot file in the /languages folder at /wp-content/themes/vantage. Your translation files created by POEditor should be placed in a /languages folder in the child theme. You can install the child theme from Appearance > Themes > Add New: Upload Theme.
I’d highly recommend not going this route. It’s an intermediate level task. Loco Translate was created to bridge the gap and make it much easier to translate strings in a theme.
Thank you for his clarification.
I already use a child theme, so no worries for updates.
But I would hate to use a plugin to change two words …I’m not at my computer now so I can’t check.
Go to inc/template-tags.php, locate the posted on function. If it is wrapped in a if function exists check you can then copy that entire function including the if function exists check and paste it into your child theme functions.php file. From there you can edit the string in question. Best to have ftp access ready as any small mistake in functions will cause your site to white screen.Great, thank you this is probably the correct file .
I created a template -tags file with the code but it does not work , where the error comes !
Thank you very much for already helped!<?
/**
* Filter the title to shorten it. This is used by vantage_content_nav function.
*
* @param $title
* @return string
*/
function vantage_posted_on() {
$posted_on_parts = array(
‘on’ => __( ‘Posté dans <time class=”entry-date” datetime=”%3$s”>%4$s</time><time class=”updated” datetime=”%5$s”>%6$s</time>’, ‘vantage’),
‘by’ => __( ‘<span class=”byline”> par <span class=”author vcard”>%9$s</span></span>’, ‘vantage’ ),
);
$posted_on_parts = apply_filters(‘vantage_post_on_parts’, $posted_on_parts);$posted_on = sprintf( implode(‘ ‘, $posted_on_parts),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( ‘c’ ) ),
apply_filters(‘vantage_post_on_date’, esc_html( get_the_date() )),
esc_attr( get_the_modified_date( ‘c’ ) ),
esc_html( get_the_modified_date() ),
esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) ),
esc_attr( sprintf( __( ‘View all posts by %s’, ‘vantage’ ), get_the_author() ) ),
get_the_author()
);
echo apply_filters(‘vantage_posted_on’, $posted_on);
}
endif;if(!function_exists(‘vantage_display_logo’)):
Glad to hear you’ve been having a go at this ?? It’ll need to be carried out as I initially indicated, within your child theme functions.php file. If there isn’t one, create one. Here is the function to insert:
if ( ! function_exists( 'vantage_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. * * @since vantage 1.0 */ function vantage_posted_on() { $posted_on_parts = array( 'on' => __( 'Posted on <a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a><time class="updated" datetime="%5$s">%6$s</time>', 'vantage'), 'by' => __( '<span class="byline"> by <span class="author vcard"><a class="url fn n" href="%7$s" title="%8$s" rel="author">%9$s</a></span></span>', 'vantage' ), ); $posted_on_parts = apply_filters('vantage_post_on_parts', $posted_on_parts); $posted_on = sprintf( implode(' ', $posted_on_parts), esc_url( get_permalink() ), esc_attr( get_the_time() ), esc_attr( get_the_date( 'c' ) ), apply_filters('vantage_post_on_date', esc_html( get_the_date() )), esc_attr( get_the_modified_date( 'c' ) ), esc_html( get_the_modified_date() ), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'vantage' ), get_the_author() ) ), get_the_author() ); echo apply_filters('vantage_posted_on', $posted_on); } endif;
If you’re create a new functions.php file it needs an opening PHP tag:
<?php
Hope that helps ??
Sorry I do not speak much English … I did not realize the need to copy the functions in the file!
Now it’s working thanks to you! A thousand thanks ??No problem ?? Awesome, really glad to hear you were able to resolve.
All the best.
- The topic ‘Problem post’ is closed to new replies.