Viewing 5 replies - 1 through 5 (of 5 total)
  • peiqinglong

    (@peiqinglong)

    <? php $d = strtolower(get_the_time('D')); echo ("<img src='bloginfo('theme_url');'> "); ?>

    Should work. Basically to combine PHP functions together, you strip out <? php and ?> from one of the functions and combine it into the other one where you want it to appear.

    Thread Starter macbros

    (@macbros)

    Tried that already and it doesn’t work.
    <?php $d = strtolower(get_the_time(‘D’)); echo (“<img src=’bloginfo(‘theme_url’);/img/date/{$d}.png’> “); ?>
    would be the full code.

    Thread Starter macbros

    (@macbros)

    it ends up outputting this.
    <img src=’bloginfo(‘theme_url’); /img/date/mon.png’>

    Thread Starter macbros

    (@macbros)

    OK I got it folks.
    I’ll past what I got just in case somebody else runs into the problem.

    <img src='<?php bloginfo(‘template_url’); ?><?php $d = strtolower(get_the_time(‘D’)); echo (“/img/date/{$d}.png’> “); ?>

    Thread Starter macbros

    (@macbros)

    BTW if anybody’s interested in making the post dates images all you do is replace this:
    <?php the_time('D j M Y'); ?>

    with this:
    <img src='<?php bloginfo('template_url'); ?><?php $d = strtolower(get_the_time('D')); echo ("/img/date/{$d}.png'> "); ?>
    <img src='<?php bloginfo('template_url'); ?><?php $m = strtolower(get_the_time('M')); echo ("/img/date/{$m}.png'> "); ?>
    <img src='<?php bloginfo('template_url'); ?><?php $j = strtolower(get_the_time('j')); echo ("/img/date/{$j}.png'> "); ?>
    <img src='<?php bloginfo('template_url'); ?><?php $y = strtolower(get_the_time('Y')); echo ("/img/date/{$y}.png'> "); ?>

    make you’re images and you’re good to go.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘php inside php’ is closed to new replies.