wordpress主题找不到html来添加锚标签

时间:2012-12-08 16:54:54

标签: html html5 wordpress themes

我正在编辑[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 -->';
        } 
    ?>

2 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分:0)

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

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=""中指定的相同网址复制到所有三个小部件。