Hide posted date from page source

Hello dear Athemes team. I want to hide posted and updated date and time from page source in pages and posts. How can I do it?

Hello,

First thanks for using our Sydney Pro theme!

Please try adding the given custom CSS code below at Appearance > Customize > Additional CSS:

.hentry .meta-post {
	display: none;
}

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo.

aThemes Support

Hello, thank you for answering. Unfortunately this code not helped to my problem. published, modified and updated date and time not hidden.
https://www.bakusteel.com/az/qiymet6/ you can check this link

Hello,

That’s a cache issue. I entered your website now and it’s working:

image

Please try again clearing your browser cache. If you have a cache plugin enabled, purge the cache too.

We hope this helps!

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo.

aThemes Support

no I want this info on my post, I want clear info in page source, I mean when client look to the View Page Source property of page or post, he/she cannot see when I update or modify this page or post. Because sometimes we create page or post with old date that is why we want hide this info, but cannot

Hello,

Oh, right! Understood now.

The only way is through the Sydney Pro Child Theme, where you can change the theme source code and remove the datetime attributes.

You can download a pre-made child theme for Sydney Pro here and also learn more about that:

You should copy the content-single.php from parent theme and paste inside the child theme folder, then locate the post meta code and change as per your needs.

I saw you are using a very old version of Sydney Pro, if you do not find the content-single.php, please look for single.php to make the changes.

We hope this helps!

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo.

aThemes Support

1 Like

Thank you so much for detailed answering. I use child theme of sydney. if I want show post published date on post or pages but hide from Page sources of page or post properties , what I should change exactly? I’m not professional in this area, If you help, I’ll be so happy

I added content-single.php, when I delete posted on function , published time on posts are hidden , but I want show this info, and hide only page source updated time :frowning:

Hello,

Great! We are almost there!

In the child theme content-single.php replace the function <?php sydney_posted_on(); ?> with the code below:

<?php
$time_string = '<time class="entry-date published updated" datetime="%1$s" ' . sydney_get_schema( 'published_date' ) . '>%2$s</time>';

$time_string = '<time class="entry-date published updated">%2$s</time>';

if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {

    $time_string = '<time class="entry-date published">%2$s</time><time class="updated">%4$s</time>';

}

$time_string = sprintf( $time_string,

    esc_attr( get_the_date( 'c' ) ),

    esc_html( get_the_date() ),

    esc_attr( get_the_modified_date( 'c' ) ),

    esc_html( get_the_modified_date() )

);

$posted_on = sprintf(

    _x( 'Posted %s', 'post date', 'sydney' ),

    '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'

);

$byline = sprintf(

    _x( '%s', 'post author', 'sydney' ),

    '<span class="author vcard" ' . sydney_get_schema( 'author_name' ) . '><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'

);

echo '<span class="posted-on"><i class="sydney-svg-icon">' . sydney_get_svg_icon( 'icon-calendar', false ) . '</i>' . $posted_on . '</span><span class="byline"> ' . '<i class="sydney-svg-icon">' . sydney_get_svg_icon( 'icon-user', false ) . '</i>' . $byline . '</span>';

if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {

    echo '<span class="comments-link"><i class="sydney-svg-icon">' . sydney_get_svg_icon( 'icon-comments', false ) . '</i>';

    comments_popup_link( __( 'Leave a comment', 'sydney' ), __( '1 Comment', 'sydney' ), __( '% Comments', 'sydney' ) );

    echo '</span>';

}

$categories_list = get_the_category_list( __( ', ', 'sydney' ) );

if ( !is_single() && $categories_list && sydney_categorized_blog() ) {

    printf( '<span class="cat-links"><i class="sydney-svg-icon">' . sydney_get_svg_icon( 'icon-categories', false ) . '</i>' . __( 'Posted in %1$s', 'sydney' ) . '</span>', $categories_list );

} ?>

We hope this helps!

Please try that and let us know if you need further assistance.

Kind Regards,

Rodrigo.

aThemes Support

I added this, but not sure I did true, because my posts not worked after adding this code:

<?php /** * @package Sydney */ ?> >
<?php do_action('sydney_inside_top_post'); ?>

<?php if ( has_post_thumbnail() && ( get_theme_mod( 'post_feat_image' ) != 1 ) ) : ?>
	<div class="entry-thumb">
		<?php the_post_thumbnail('large-thumb'); ?>
	</div>
<?php endif; ?>

<header class="entry-header">
	<?php the_title( '<h1 class="title-post entry-title">', '</h1>' ); ?>

	<?php if (get_theme_mod('hide_meta_single') != 1 ) : ?>
	<div class="meta-post">
				<?php

$time_string = '<time class=“entry-date published updated” datetime="%1$s" ’ . sydney_get_schema( ‘published_date’ ) . ‘>%2$s’;

$time_string = ‘%2$s’;

if ( get_the_time( ‘U’ ) !== get_the_modified_time( ‘U’ ) ) {

$time_string = '<time class="entry-date published">%2$s</time><time class="updated">%4$s</time>';

}

$time_string = sprintf( $time_string,

esc_attr( get_the_date( 'c' ) ),

esc_html( get_the_date() ),

esc_attr( get_the_modified_date( 'c' ) ),

esc_html( get_the_modified_date() )

);

$posted_on = sprintf(

_x( 'Posted %s', 'post date', 'sydney' ),

'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'

);

$byline = sprintf(

_x( '%s', 'post author', 'sydney' ),

'<span class="author vcard" ' . sydney_get_schema( 'author_name' ) . '><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'

);

echo ‘’ . sydney_get_svg_icon( ‘icon-calendar’, false ) . ‘’ . $posted_on . ’ ’ . ‘’ . sydney_get_svg_icon( ‘icon-user’, false ) . ‘’ . $byline . ‘’;

if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {

echo '<span class="comments-link"><i class="sydney-svg-icon">' . sydney_get_svg_icon( 'icon-comments', false ) . '</i>';

comments_popup_link( __( 'Leave a comment', 'sydney' ), __( '1 Comment', 'sydney' ), __( '% Comments', 'sydney' ) );

echo '</span>';

}

$categories_list = get_the_category_list( __( ', ', ‘sydney’ ) );

if ( !is_single() && $categories_list && sydney_categorized_blog() ) {

printf( '<span class="cat-links"><i class="sydney-svg-icon">' . sydney_get_svg_icon( 'icon-categories', false ) . '</i>' . __( 'Posted in %1$s', 'sydney' ) . '</span>', $categories_list );

} ?>

	</div><!-- .entry-meta -->
	<?php endif; ?>
</header><!-- .entry-header -->

<div class="entry-content">
	<?php the_content(); ?>
	<?php
		wp_link_pages( array(
			'before' => '<div class="page-links">' . __( 'Pages:', 'sydney' ),
			'after'  => '</div>',
		) );
	?>
</div><!-- .entry-content -->

<footer class="entry-footer">
	<?php sydney_entry_footer(); ?>
</footer><!-- .entry-footer -->

<?php do_action('sydney_inside_bottom_post'); ?>

after adding code to cotent-single.php pages work correctly and date not seems, but my post pages not work. you can see post below
https://www.bakusteel.com/az/sergi/

preloader function overflow of page

Hello,

In this case we will need make the change directly from your site as you are using a old version of Sydney Pro and probably that’s the issue. Thus I request sharing your website’s temporary admin login link and send it privately to me over email. You can generate the link with this plugin .

Email

rodrigo@athemes.com

P.S.: Ensure the link expiry is set to 7 days and all admin rights are enabled.
P.S 2: Ensure you have the Sydney Pro child theme installed.

Kind Regards,

Rodrigo.

aThemes Support