2017-06-23 2 views
0

Ich entwarf eine Website für einen Kunden, aus WordPress. Aber ich möchte, dass das Design mit WordPress funktioniert, denn auf der Website sollten sie Nachrichten veröffentlichen können. Ich werde die Nachrichten mit den Funktionen von WordPress bekommen. Ich habe das Thema ausgeführt, aber ich habe ein Problem mit den Links der Menüs, CSS, JS, etc. Ich möchte wissen, wo zu konfigurieren, so dass die Routen korrekt sind.Pfade von Dateien in eigenem Thema [Wordpress]

Die Webstruktur enthält die Ordner css, img, js, template, index.php, style.php.

Ich habe eine default-head.php-Datei und scripts.php im Vorlagenordner, der dies enthält.

default-head.php

<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<meta http-equiv="Cache-Control" content="no-cache"> 
<link rel="stylesheet" href="css/sidr.light.css"> 
<link rel="stylesheet" href="css/bootstrap.min.css"> 
<link rel="stylesheet" href="style.css"> 
<link rel="stylesheet" href="css/bootstrap-overwrite.css"> 
<link rel="stylesheet" href="css/font-awesome.min.css"> 
<link rel="shortcut icon" type="image/png" href="img/favicon.png"/> 

scripts.php

<script src="js/jquery-1.11.1.min.js"></script> 
<script src="js/bootstrap.min.js"></script> 
<script src="js/functions.js"></script> 
<script src="js/sidr.min.js"></script> 
<script src="js/bootbox.min.js"></script> 

Diese Dateien im Index enthalten sind. Der Code meiner Speisekarte ist.

<div class="container-fluid"> 
     <div class="row"> 
      <div id="header" class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> 
       <div class="navbar navbar-inverse navbar-static-top" role="navigation"> 
        <div class="container-fluid"> 
         <div class="navbar-header"> 
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse"> 
          <span class="sr-only">Toggle navigation</span> 
          <span class="icon-bar"></span> 
          <span class="icon-bar"></span> 
          <span class="icon-bar"></span> 
          </button> 
          <a id="logo" href="/"></a> 
         </div> 

         <div class="navbar-collapse collapse"> 
          <ul class="nav navbar-nav"> 
          <li><a href="/" class="first"><span class="fa fa-home"></span>Inicio</a></li> 
          <li><a href="noticias.php"><span class="fa fa-newspaper-o"></span>Noticias</a></li> 
          <li><a href="eventos.php"><span class="fa fa-calendar"></span>Eventos</a></li> 
          <li><a href="acerca.php"><span class="fa fa-info"></span>Acerca</a></li> 
          <li><a href="contacto.php"><span class="fa fa-phone"></span>Contacto</a></li> 
          </ul> 

          <!-- <ul class="nav navbar-nav navbar-right"> 
          <li class="dropdown"> 
           <li><a href="#"><span class=""></span>Asociarme</a></li> 
          </li> 
          </ul> --> 

         </div> 
        </div> 
       </div> 
      </div> 
     </div> 

    </div> 

Vielen Dank im Voraus.

Ich werde vorsichtig sein.

Grüße

+0

was haben Sie bisher versucht? Post einige Beispielcode. –

Antwort

0

Werfen Sie einen Blick auf https://developer.wordpress.org/reference/functions/wp_enqueue_style/

Beispiel

wp_enqueue_script('oxfam_js_cookie', 'https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.1.0/js.cookie.min.js', array(), null, true); 

wird

<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.1.0/js.cookie.min.js'></script> 

oder ein basisches Methode

hinzufügen

<img src="<?php echo get_template_directory_uri(); ?>/images/image.jpg"/> 

Zusätzliche Antwort Verknüpfung für Grund

Sie können dies nur in der PHP-Dateien verwenden

kundenspezifische Modifikationen

<!-- CSS 
    ========== 
<link href="<?php //bloginfo('template_directory'); ?>/dist/css/bootstrap.min.css" rel="stylesheet" media="screen"> 
<link href="<?php //bloginfo('template_directory'); ?>/fonts/fontstyles.css" rel="stylesheet" media="screen"> 
<link rel="stylesheet" type="text/css" href="<?php //bloginfo('stylesheet_url'); ?>" media="all">--> 
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" /> 
<!-- Favicons 
    ========== --> 
<link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" /> 
<link rel="apple-touch-icon" href="<?php bloginfo('template_directory'); ?>/media/images/apple-touch-icon.png"> 
<link rel="apple-touch-icon" sizes="72x72" href="<?php bloginfo('template_directory'); ?>/media/images/apple-touch-icon-72x72.png"> 
<link rel="apple-touch-icon" sizes="114x114" href="<?php bloginfo('template_directory'); ?>/media/images/apple-touch-icon-114x114.png"> 
+0

Mein Wordpress wird unter http: // localhost/wp/wp-content/themes/mytheme gehostet. Mit get_template_directory_uri(); Meine Links haben das Format http: //localhost/wp/wp-content/themes/mytheme/my-menu-link.php. Ich möchte, dass sie ein Format von http: // localhost/wp/mein-menu-link als Wordpress-Standardthemen haben. Ich kann nicht konfigurieren, so dass meine Links auf diese Weise generiert werden. – Marcelo