• I want to be able to reference the theme directory in a page/post using php code. I don’t know how to do this with WordPress but other CMS use something like a path_to_home php variable like

    <img src="<?php path_to_home() . 'images/image.jpb'; ?>">

Viewing 1 replies (of 1 total)
  • Whenever using any WordPress function with get_xyz_etc() make sure you ECHO the function if you want to output the value there:

    <img class="first-slide" src="<?php echo get_template_directory_uri() . '/images/landing-banner.png'; ?>" alt="First slide">

Viewing 1 replies (of 1 total)
  • The topic ‘How to use theme function in post/page?’ is closed to new replies.