Forums

Insert WP tags indirectly inside php (1 post)

  1. fjvasselai
    Member
    Posted 2 years ago #

    What I would like to do is to use a WordPress tag inside a php but not with its proper call. For instance:

    We have the tag the_ID, that works trough <?php the_ID();>

    But I would like to do something like:

    <?php $myvariable = the_ID();>

    But with that code, I got the retrieved the_ID printed on the screen, not saved into $myvariable. And I can not avoid that commonly using <?php the_ID();> because I can not pass a php inside another php.

    Any help??

Topic Closed

This topic has been closed to new replies.

About this Topic