php index.php文件中的图像

php index.php文件中的图像,php,wordpress,Php,Wordpress,我想在image2类中插入一个图像,如下代码所示。我尝试了很多不同的方法,但每次都得到一个“?”的答案 图片上传到我的网站运行的同一个网络酒店 目录文件:/www/wp content/themes/jonas/images/meg.jpg 这是我的wordpress主题的index.php文件 代码发布在 嗨,我是一名来自挪威的设计专业学生 向下滚动查看工作:-) 您可以使用此功能尝试以下操作: get_header(); ?> 嗨,我是一名来自挪威的设计专业学生 向下滚动查看工作:-) /

我想在image2类中插入一个图像,如下代码所示。我尝试了很多不同的方法,但每次都得到一个“?”的答案

图片上传到我的网站运行的同一个网络酒店

目录文件:/www/wp content/themes/jonas/images/meg.jpg

这是我的wordpress主题的index.php文件

代码发布在


嗨,我是一名来自挪威的设计专业学生
向下滚动查看工作:-)
您可以使用此功能尝试以下操作:
get_header();
?>
嗨,我是一名来自挪威的设计专业学生
向下滚动查看工作:-)
/wp content/themes/jonas/images/meg.jpg/>

我在css中使用witdh和height调整图像大小时遇到问题。有什么想法吗?在自定义样式表中使用这个类
。intro-tekst img{width:youwidth px;}
太好了,你是一个传奇!
<?php

get_header();
?>


<div class="intro-tekst">
<h1>HI, IM A DESIGN STUDENT FROM NORWAY</h1>

<h3>Scroll down for work:-)</h3>


    <div class="image2">

    <!-- I want to insert "meg.jpg" image here -->

    </div>


</div>


<?php
if (have_posts()) :
  while (have_posts()) : the_post(); ?>

<div class="wrap">
  <article class="post">
   <h2 class="overskrift"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
      <?php the_content(); ?>

    </article>

</div>

  <?php endwhile;

  else :
    echo "<p>No content found</p>";

  endif;


get_footer();

 ?>
    get_header();
    ?>


    <div class="intro-tekst">
    <h1>HI, IM A DESIGN STUDENT FROM NORWAY</h1>

    <h3>Scroll down for work:-)</h3>


        <div class="image2">

        <img src="<?php echo get_site_url(); ?>/wp-content/themes/jonas/images/meg.jpg"  />

        </div>


    </div>


    <?php
    if (have_posts()) :
      while (have_posts()) : the_post(); ?>

    <div class="wrap">
      <article class="post">
       <h2 class="overskrift"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
          <?php the_content(); ?>

        </article>

    </div>

      <?php endwhile;

      else :
        echo "<p>No content found</p>";

      endif;


    get_footer();

     ?>