【问题标题】:wordpress theme can't find html to add anchor tagswordpress 主题找不到html来添加锚标签
【发布时间】:2012-11-26 14:34:20
【问题描述】:

我正在编辑 [Nimble Wordpress 主题] (http://www.elegantthemes.com/demo/?theme=Nimble),我正在尝试编辑主页上的“了解更多”按钮,以便他们会将用户带到“关于”子页面上的特定部分。现在他们将用户带到 3 个单独的子页面,理想情况下,我希望他们将用户带到单个“关于”页面上的特定部分。我可以在 Wordpress 编辑器中访问“关于”页面的 HTML,但我不能找到主页的 html 以更改标签。该主题仅允许我通过电子面板进行非常小的更改。所有后端文件都是基于 .php 的,我只拥有 HTML 知识,而不是 PHP。任何见解将不胜感激。谢谢!

** 感谢您的提示!有没有办法修改 PHP 以便我可以指定 3 个单独的链接?每个小部件一个链接?**

<?php 
        if ( 'on' == et_get_option( 'nimble_display_services', 'on' ) ){
            $blurbs_number = apply_filters( 'et_blurbs_number', 3 );
            echo '<div id="services" class="clearfix">';
                for ( $i = 1; $i <= $blurbs_number; $i++ ){
                    $service_query = new WP_Query( apply_filters( 'et_service_query_args', 'page_id=' . get_pageId( html_entity_decode( et_get_option( 'nimble_home_page_' . $i ) ) ), $i ) );
                    while ( $service_query->have_posts() ) : $service_query->the_post();
                        global $more;
                        $more = 0;
                        $page_title = ( $blurb_custom_title = get_post_meta( get_the_ID(), 'Blurbtitle', true ) ) && '' != $blurb_custom_title ? $blurb_custom_title : apply_filters( 'the_title', get_the_title() );
                        $page_permalink = ( $blurb_custom_permalink = get_post_meta( get_the_ID(), 'Blurblink', true ) ) && '' != $blurb_custom_permalink ? $blurb_custom_permalink : get_permalink();

                        echo '<div class="service' . ( 1 == $i ? ' first' : '' ) . ( $blurbs_number == $i ? ' last' : '' ) . '">';
                            if ( ( $page_icon = get_post_meta( get_the_ID(), 'Icon', true ) ) && '' != $page_icon )
                                printf( '<img src="%1$s" alt="%2$s" class="et_page_icon" />', esc_url( $page_icon ), esc_attr( $page_title ) );

                            echo '<h3>' . $page_title . '</h3>';

                            if ( has_excerpt() ) the_excerpt();
                            else the_content( '' );

                            echo '<a href="' . esc_url( $page_permalink ) . '" class="learn-more">' . __( 'Learn More', 'Nimble' ) . '</a>';

                        echo '</div> <!-- end .service -->';
                    endwhile; 
                    wp_reset_postdata();
                }
            echo '</div> <!-- end #services -->';
        } 
    ?>

【问题讨论】:

  • 尝试提供一些代码(index.php)

标签: html wordpress themes


【解决方案1】:

要编辑了解更多按钮链接网址,您必须调整以下代码行:

echo '<a href="' . esc_url( $page_permalink ) . '" class="learn-more">' . __( 'Learn More', 'Nimble' ) . '</a>';

echo '<a href="http://url-of-the-page-you-want-to-display" class="learn-more">' . __( 'Learn More', 'Nimble' ) . '</a>';

P.S:上面的代码会将href=""中指定的相同URL复制到所有三个小部件。

【讨论】:

    【解决方案2】:

    在您的主题文件夹中找到 index.php(这是控制您的主页的 PHP 文件)。在stackoverflow上复制代码。我会告诉你在这个页面上要改变什么。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-23
      • 1970-01-01
      • 2011-01-15
      • 1970-01-01
      • 2014-06-13
      • 1970-01-01
      相关资源
      最近更新 更多