skip to Main Content

I am having problems with this code below :

<?php if ( $arts_menu_overlay_circle_contents === 'logo' ) : ?>


<?php get_template_part( 'template-parts/logo/logo' ); ?>

<?php endif; ?>

I want to set an custom logo but it automatically takes the logo.php part.
I want it to get an image like .jpg or .png
Anyone can help me ?
Thanks in advance!

3

Answers


  1. Chosen as BEST ANSWER

    Thanks All for supporting me . I have solved my problem by using a simple markup instead of php code that wordpress use. The code markup is :

    <img src="https://placehold.it/200x200" width="200" height="200" alt="" />
    

    Thanks Again all of you.


  2. If i understand you correctly and assume i know little wordpres (very little), i got this link https://developer.wordpress.org/reference/functions/get_template_part/.

    There is described how you will be rewriting the template file of the logo, which is php file.

    So inside this template file you have to change maybe the path to your logo.

    Login or Signup to reply.
  3. First of all you don’t need to come to code this soon while using WordPress. All modern themes comes with Theme Options or customize option where you can place your logo. That’s your first options. So try to find Theme Options Menu on your Dashboard. Otherwise go to Appearance > Customize and see the Header option to change the logo.

    1. get_template_part( ‘template-parts/logo/logo’ );

    This refers to location template-parts -> logo -> logo.php inside your activated theme. So, appropreate solution will be create same folder and file in your child theme and change the code in logo.php to place your logo file directly.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search