用php添加url到wordpress

时间:2017-01-11 16:40:32

标签: php html wordpress url

这是我的投资组合http://portfolio1426.zzz.com.ua/。在“投资组合”部分中&#39;我添加了我的一个网站。如果按一个按钮&#39;看看它&#39;你可以看到项目的标题和描述。此处还有一个链接&#39; Site&#39;。如果您按下该链接,该链接不会将您重定向到此网站,但会在包含ID&#39; http://portfolio1426.zzz.com.ua/#work_0&#39;的页面上重定向。 。我无法更改我的HTML代码,或者在添加<a href ='http://ovk.zzz.com.ua/ovk/'> site here </a>

在描述中它也不起作用。我知道问题出在我的PHP代码中,但我不明白错误是什么。 这是我的PHP代码:

`              

                                                                                                    
                            一切都有效                         网站                         Identica                         徽标                     
                                 

                <?php if ( have_posts() ) : query_posts('cat=7');
                    while (have_posts()) : the_post(); ?>


                        <div class="mix col-md-3 col-sm-6 col-xs-6 portfolio_item <?php
                        $tags = wp_get_post_tags($post->ID);
                        if ($tags) {
                            foreach($tags as $tag) {
                                echo ' ' . $tag->name;
                            }
                        }
                        ?> ">
                            <?php the_post_thumbnail(array(600, 600)); ?>
                            <div class="port_item_cont">
                                <h3> <?php the_title(); ?></h3>
                                <?php the_excerpt(); ?>
                                 <a href="#" class="popup_content">Look at it
                                </a>
                            </div>

                            <div class="hidden">
                                <div class="podrt_descr">
                                    <div class="modal-box-content">
                                        <button class="mfp-close" type="button" title="Закрыть (Esc)">×</button>
                                        <h3><?php the_title(); ?></h3>
                                        <?php the_content(); ?>
                                       <img src="<?php $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );
                                        echo $large_image_url[0];
                                        ?>" alt="<?php the_title(); ?>"/>
                                    </div>
                                </div>
                            </div>
                        </div>

                    <? endwhile; endif; wp_reset_query(); ?>


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

`

请帮我解决这个问题。

1 个答案:

答案 0 :(得分:0)

好吧似乎the_content()WordPress函数正在删除html代码。 “此处的网站”链接未链接。

也许你的主题是使用从帖子内容中删除html标签的过滤器功能