WordPress导航图像 [英] WordPress navigation with images

查看:81
本文介绍了WordPress导航图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我正在WordPress网站上工作.除了我的导航之外,其他一切都很好.我不想使用WordPress使用的基于标准文本和CSS的导航,而是插入带有图形图像的我自己的导航(PNG文件,不过可以根据需要更改文件类型).

I am working on a WordPress site at the moment. Everything is doing fine except my navigation. I don't want to use the standard text and css based navigation WordPress uses, but insert my own navigation with graphic images (PNG files, Can change filetype if necessary though).

有人知道WordPress的任何形式的插件,该插件可以让您在导航中使用图像而不是文本吗?

Does anyone know of any sort of plugin for WordPress that allows you to have images instead of text in the navigation?

关于, 纳德

推荐答案

您要拥有自己的CSS文件吗? 如果是的话,您可以使用此字眼说出wordpress使用您自己的css文件:

do you want to have your own css file ? if it is you can just use this to say to wordpress use your own css file :

wp_enqueue_style( $handle, $src, $deps, $ver, $media );

示例:

<?php

    /*
     * This example will work with WordPress 2.7
     */

    /*
     * register with hook 'wp_print_styles'
     */
    add_action('wp_print_styles', 'add_my_stylesheet');

    /*
     * Enqueue style-file, if it exists.
     */

    function add_my_stylesheet() {
        $myStyleUrl = plugins_url('style.css', __FILE__); // Respects SSL, Style.css is relative to the current file
        $myStyleFile = WP_PLUGIN_DIR . '/myPlugin/style.css';
        if ( file_exists($myStyleFile) ) {
            wp_register_style('myStyleSheets', $myStyleUrl);
            wp_enqueue_style( 'myStyleSheets');
        }
    }

?>

这篇关于WordPress导航图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆