I
I
Ivan Dobroslavin2020-05-26 14:37:00
WordPress
Ivan Dobroslavin, 2020-05-26 14:37:00

How to display a variable in the right place?

The following code displays the date the post was modified, a date icon ( ) and more.<span class="posted-on">
5eccff0295fe5851261882.png

function awaken_posted_on() {
  $abc = the_modified_date();	
  //$time_string = awaken_posted_datetime();

  $posted_on = $time_string ;
  

  $byline = '<span class="author vcard">' . esc_html( get_the_author() ) .'</span>';

  echo '<span class="posted-on">' . '</span><span class="byline">' . $byline . '</span>';

}


Question: how to display a variable after the date icon ?
This construct doesn't work:
echo '<span class="posted-on">'. $abc . '</span><span class="byline">' . $byline . '</span>';

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bingumd, 2020-05-26
@derzost_namereniya

replace:
the_modified_date()
with:
get_the_modified_date();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question