我为WordPress的客户设计了一个网站。但我希望设计能够与WordPress一起使用,因为在网站上他们应该能够发布新闻。我将通过WordPress的功能获得新闻。我有主题运行,但我的菜单,CSS,js等链接有问题。我想知道在哪里配置,以便路线正确。
网页结构包含css,img,js,template,index.php,style.php文件夹。
我在包含此文件的模板文件夹中有一个default-head.php文件和scripts.php。
默认-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>
这些文件包含在索引中。我的菜单代码是。
<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>
提前致谢。
我会小心的。
此致
答案 0 :(得分:0)
看一看 https://developer.wordpress.org/reference/functions/wp_enqueue_style/
示例
<script type='text/javascript' src='https://cdnjs.cloudflare.com/ajax/libs/js-cookie/2.1.0/js.cookie.min.js'></script>
将添加
<img src="<?php echo get_template_directory_uri(); ?>/images/image.jpg"/>
您可以在PHP文件中使用它进行基本链接
<!-- 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">
补充答案
自定义修改
public static void main(String[] args) throws IOException {
PdfDocument pdf = new PdfDocument(new PdfWriter("table.pdf"));
Document document = new Document(pdf);
Table table = new Table(new float[]{1, 4, 4});
table.setWidthPercent(50);
table
.addHeaderCell(
new Cell().add("A")
.setTextAlignment(TextAlignment.CENTER))
.addHeaderCell(
new Cell().add("B")
.setTextAlignment(TextAlignment.CENTER))
.addHeaderCell(
new Cell().add("C")
.setTextAlignment(TextAlignment.CENTER));
for (int i = 1; i < 11; i++) {
table
.addCell(
new Cell().add(String.format("%s.", i))
.setTextAlignment(TextAlignment.RIGHT)
.setBorderTop(Border.NO_BORDER)
.setBorderBottom(Border.NO_BORDER))
.addCell(
new Cell().add(String.format("key %s", i))
.setBorderTop(Border.NO_BORDER)
.setBorderBottom(Border.NO_BORDER))
.addCell(
new Cell().add(String.format("value %s", i))
.setBorderTop(Border.NO_BORDER)
.setBorderBottom(Border.NO_BORDER));
}
table
.addFooterCell(
new Cell().add("A")
.setTextAlignment(TextAlignment.CENTER))
.addFooterCell(
new Cell().add("B")
.setTextAlignment(TextAlignment.CENTER))
.addFooterCell(
new Cell().add("C")
.setTextAlignment(TextAlignment.CENTER));
document.add(table);
document.close();
}