Wordpress duplicates the permalink

Asked

Viewed 120 times

1

In wordpress on the homepage are all the posts I made. In each post has the title and a photo.

In the title, the title link is correct, for example:

 `meusite.com.br/post1`

But in the photo, the link appears like this:

`meusite.com.br/post1/post1`

He’s duplicating the photo link.

This is the code

        <div class="posts"><!-- Posts Individuais das Notícias -->
            <header>
                <h1>
                    <a class="titulo" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">
                        <?php the_title(); ?>
                    </a>
                    <span>
                        <?php comments_popup_link( 'Comente', '1 comentário', '% comentários', 'comments-link pop-comentario', 'Comentários está desativados para este post');?>
                    </span>
                </h1>
            </header>

            <?php if ( in_category( 'video' ) ) : ?>

                <div align="center"class="embed-responsive embed-responsive-16by9 video-mp4">
                    <video id="videomp4" class="embed-responsive-item" controls>
                        <source src="<?php echo get_post_meta( get_the_ID(), 'mp4', true ); ?>" type="video/mp4">
                        <source src="<?php echo get_post_meta( get_the_ID(), 'ogg', true ); ?>" type="video/ogg">
                        <source src="<?php echo get_post_meta( get_the_ID(), 'webm', true ); ?>" type="video/webm">
                        Your browser does not support HTML5 video.
                    </video>
                </div>

            <?php else : ?>

                <?php the_content(); ?>
<div>

This is the html of one of the posts:

                        <div class="posts"><!-- Posts Individuais das Notícias -->
            <header>
                <h1>
                    <a class="titulo" href="http://localhost/meusite/Que-demais/" rel="bookmark" title="Que demais">
                        Que demais                      </a>
                    <span>
                        <a href="http://localhost/meusite/Que-demais/#respond" class="comments-link pop-comentario" >Comente</a>                        </span>
                </h1>

            </header>

                                    <a class="titulo" href="http://localhost/meusite/Que-demais/" rel="bookmark" title="Que demais">
                        <p><a href="http://localhost/meusite/Que-demais/Que-demais/" rel="attachment wp-att-39"><img class="alignnone size-full wp-image-39" src="http://localhost/meusite/wp-content/uploads/2016/01/Que-demais.jpg" alt="Que demais" width="460" height="460" srcset="http://localhost/meusite/wp-content/uploads/2016/01/Que-demais-150x150.jpg 150w, http://localhost/meusite/wp-content/uploads/2016/01/Que-demais-300x300.jpg 300w, http://localhost/meusite/wp-content/uploads/2016/01/Que-demais-200x200.jpg 200w, http://localhost/meusite/wp-content/uploads/2016/01/Que-demais.jpg 460w" sizes="(max-width: 460px) 100vw, 460px" /></a></p>
                    </a>

            </div><!-- Fecha Posts Individuais das Notícias -->     

And down here is all html:

<head>
    <meta charset="UTF-8" />
    <!-- www.phied.com/condicional-comments-block-downloads/-->
    <!--[if IE]><![endif]-->

    <meta name="description" content="">
    <meta name="author" content="">

    <meta http-equiv="X-UA-Compatible" content="IE-edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale-1">

    <title>
        Meu site Teste
    </title>

    <!-- Bootstrap -->
    <link rel="stylesheet" href="http://localhost/meusite/wp-content/themes/tema-meusite/css/reset.css">
    <link rel="stylesheet" href="http://localhost/meusite/wp-content/themes/tema-meusite/css/normalize.css">
    <link rel="stylesheet" href="http://localhost/meusite/wp-content/themes/tema-meusite/css/bootstrap.min.css">
    <link rel="stylesheet" href="http://localhost/meusite/wp-content/themes/tema-meusite/style.css" type="text/css" media="screen" />

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->    


    <style type="text/css">

        body{
            background: url(http://localhost/meusite/wp-content/themes/tema-meusite/imagens/fundo.jpg) no-repeat center center fixed;
              background-size: cover; /*Css padrão*/
              -webkit-background-size: cover; /*Css safari e chrome*/
              -moz-background-size: cover; /*Css firefox*/
              -ms-background-size: cover; /*Css IE não use mer#^@%#*/
              -o-background-size: cover; /*Css Opera*/
            }

    </style>  
        <script type="text/javascript">window._wpemojiSettings = {"baseUrl":"http:\/\/s.w.org\/images\/core\/emoji\/72x72\/","ext":".png","source":{"concatemoji":"http:\/\/localhost\/meusite\/wp-includes\/js\/wp-emoji-release.min.js?ver=4.4.1"}};!function(a,b,c){function d(a){var c,d=b.createElement("canvas"),e=d.getContext&&d.getContext("2d");return e&&e.fillText?(e.textBaseline="top",e.font="600 32px Arial","flag"===a?(e.fillText(String.fromCharCode(55356,56806,55356,56826),0,0),d.toDataURL().length>3e3):"diversity"===a?(e.fillText(String.fromCharCode(55356,57221),0,0),c=e.getImageData(16,16,1,1).data.toString(),e.fillText(String.fromCharCode(55356,57221,55356,57343),0,0),c!==e.getImageData(16,16,1,1).data.toString()):("simple"===a?e.fillText(String.fromCharCode(55357,56835),0,0):e.fillText(String.fromCharCode(55356,57135),0,0),0!==e.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g;c.supports={simple:d("simple"),flag:d("flag"),unicode8:d("unicode8"),diversity:d("diversity")},c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.simple&&c.supports.flag&&c.supports.unicode8&&c.supports.diversity||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);</script>
    <style type="text/css">
        img.wp-smiley,
        img.emoji {
            display: inline !important;
            border: none !important;
            box-shadow: none !important;
            height: 1em !important;
            width: 1em !important;
            margin: 0 .07em !important;
            vertical-align: -0.1em !important;
            background: none !important;
            padding: 0 !important;
        }
    </style>
    <link rel='stylesheet' id='wp-pagenavi-css'  href='http://localhost/meusite/wp-content/plugins/wp-pagenavi/pagenavi-css.css?ver=2.70' type='text/css' media='all' />
    <link rel='https://api.w.org/' href='http://localhost/meusite/wp-json/' />
    <link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://localhost/meusite/xmlrpc.php?rsd" />
    <link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://localhost/meusite/wp-includes/wlwmanifest.xml" /> 
    <meta name="generator" content="WordPress 4.4.1" />
    <style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}
    </style>

</head>

<body class="home blog">

        <div id="wrap" class="container-fluid wrapper">

            <div class="row menu-topo">


                <nav class="navbar navbar-default navbar-static-top menu-topo" role="navigation">

                            <div class="logo-div col-sm-12 container-fluid">
                                <a class="logo" href="http://localhost/meusite">
                                    <img class="img-responsive" src="http://localhost/meusite/wp-content/themes/tema-meusite/imagens/logo.png">
                                </a>
                            </div>
                        <div class="navbar-header col-sm-12 pull-right visible-xs">

                            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-humor-navbar-collapse-1">
                                <span class="sr-only">Toggle navigation</span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                            </button>

                        </div>

                <div id="topo" class="clearfix"></div>
                        <div class="collapse navbar-collapse col-md-11 pull-left" id="bs-humor-navbar-collapse-1">
                            <div class="menu-menu-container"><ul id="menu-menu" class="nav navbar-nav"><li id="menu-item-5" class="menu-item menu-item-type-custom menu-item-object-custom current-menu-item current_page_item menu-item-home menu-item-5"><a href="http://localhost/meusite/">Geral</a></li>

Humor Fantasy Bugs more/less

                </nav>


            </div>  <div class="row sidebar-conteudo">

    <div id="caixa" class="col-xs-12 col-sm-9">

        <nav id="pagination-topo">
            <ul class='pagination'>     
                                </ul>
        </nav><!-- /#pagination -->


        <div class="posts"><!-- Posts Individuais das Notícias -->
            <header>
                <h1>
                    <a class="titulo" href="http://localhost/meusite/Que-demais/" rel="bookmark" title="Que demais">
                        Que demais                      </a>
                    <span>
                        <a href="http://localhost/meusite/Que-demais/#respond" class="comments-link pop-comentario" >Comente</a>                        </span>
                </h1>

            </header>

                                    <a class="titulo" href="http://localhost/meusite/Que-demais/" rel="bookmark" title="Que demais">
                        <p><a href="http://localhost/meusite/Que-demais/Que-demais/" rel="attachment wp-att-39"><img class="alignnone size-full wp-image-39" src="http://localhost/meusite/wp-content/uploads/2016/01/Que-demais.jpg" alt="Que demais" width="460" height="460" srcset="http://localhost/meusite/wp-content/uploads/2016/01/Que-demais-150x150.jpg 150w, http://localhost/meusite/wp-content/uploads/2016/01/Que-demais-300x300.jpg 300w, http://localhost/meusite/wp-content/uploads/2016/01/Que-demais-200x200.jpg 200w, http://localhost/meusite/wp-content/uploads/2016/01/Que-demais.jpg 460w" sizes="(max-width: 460px) 100vw, 460px" /></a></p>
                    </a>

            </div><!-- Fecha Posts Individuais das Notícias -->     


        <div class="posts"><!-- Posts Individuais das Notícias -->
            <header>
                <h1>
                    <a class="titulo" href="http://localhost/meusite/gordinho-cansado/" rel="bookmark" title="Gordinho cansado">
                        Gordinho cansado                        </a>
                    <span>
                        <a href="http://localhost/meusite/gordinho-cansado/#respond" class="comments-link pop-comentario" >Comente</a>                      </span>
                </h1>

            </header>

                                    <a class="titulo" href="http://localhost/meusite/gordinho-cansado/" rel="bookmark" title="Gordinho cansado">
                        <p><a href="http://localhost/meusite/gordinho-cansado/gordinho-cansado-2/" rel="attachment wp-att-25"><img class="alignnone size-full wp-image-25" src="http://localhost/meusite/wp-content/uploads/2016/01/Gordinho-cansado.gif" alt="Gordinho cansado" width="320" height="240" /></a></p>
                    </a>                    

            </div><!-- Fecha Posts Individuais das Notícias -->     


        <div class="posts"><!-- Posts Individuais das Notícias -->
            <header>
                <h1>
                    <a class="titulo" href="http://localhost/meusite/quase-impossivel/" rel="bookmark" title="Quase impossível">
                        Quase impossível                        </a>
                    <span>
                        <a href="http://localhost/meusite/quase-impossivel/#respond" class="comments-link pop-comentario" >Comente</a>                      </span>
                </h1>

            </header>

                                    <a class="titulo" href="http://localhost/meusite/quase-impossivel/" rel="bookmark" title="Quase impossível">
                        <p><a href="http://localhost/meusite/quase-impossivel/quase-impossivel-2/" rel="attachment wp-att-28"><img class="alignnone size-full wp-image-28" src="http://localhost/meusite/wp-content/uploads/2016/01/Quase-impossivel.jpg" alt="Quase impossivel" width="450" height="685" srcset="http://localhost/meusite/wp-content/uploads/2016/01/Quase-impossivel-197x300.jpg 197w, http://localhost/meusite/wp-content/uploads/2016/01/Quase-impossivel.jpg 450w" sizes="(max-width: 450px) 100vw, 450px" /></a></p>
                    </a>                    

            </div><!-- Fecha Posts Individuais das Notícias -->     


        <div class="posts"><!-- Posts Individuais das Notícias -->
            <header>
                <h1>
                    <a class="titulo" href="http://localhost/meusite/melhor-fantasia-do-south-park/" rel="bookmark" title="Melhor fantasia do South Park">
                        Melhor fantasia do South Park                       </a>
                    <span>
                        <a href="http://localhost/meusite/melhor-fantasia-do-south-park/#respond" class="comments-link pop-comentario" >Comente</a>                     </span>
                </h1>

            </header>

                                    <a class="titulo" href="http://localhost/meusite/melhor-fantasia-do-south-park/" rel="bookmark" title="Melhor fantasia do South Park">
                        <p><a href="http://localhost/meusite/melhor-fantasia-do-south-park/melhor-fantasia-do-south-park-2/" rel="attachment wp-att-30"><img class="alignnone size-full wp-image-30" src="http://localhost/meusite/wp-content/uploads/2016/01/Melhor-fantasia-do-South-Park.jpg" alt="Melhor fantasia do South Park" width="407" height="584" srcset="http://localhost/meusite/wp-content/uploads/2016/01/Melhor-fantasia-do-South-Park-209x300.jpg 209w, http://localhost/meusite/wp-content/uploads/2016/01/Melhor-fantasia-do-South-Park.jpg 407w" sizes="(max-width: 407px) 100vw, 407px" /></a></p>
                    </a>


            </div><!-- Fecha Posts Individuais das Notícias -->     

        <nav id="pagination">
            <ul class='pagination'>
                                </ul>
        </nav><!-- /#pagination -->


    </div>

            <div id="sidebar-teste" class="sidebar-lateral col-xs-12 col-sm-3">
                <aside>

<div class="item_sidebar">

<img width="150" height="150" src="http://localhost/meusite/wp-content/uploads/2016/01/Quase-impossivel-150x150.jpg" class="attachment-thumbnail size-thumbnail" alt="Quase impossivel" /></a>
</div>


<div class="item_sidebar">

<img width="150" height="150" src="http://localhost/meusite/wp-content/uploads/2016/01/Melhor-fantasia-do-South-Park-150x150.jpg" class="attachment-thumbnail size-thumbnail" alt="Melhor fantasia do South Park" /></a>
</div>


<div class="item_sidebar">

<img width="150" height="150" src="http://localhost/meusite/wp-content/uploads/2016/01/Que-demais-150x150.jpg" class="attachment-thumbnail size-thumbnail" alt="Que demais" srcset="http://localhost/meusite/wp-content/uploads/2016/01/Que-demais-150x150.jpg 150w, http://localhost/meusite/wp-content/uploads/2016/01/Que-demais-300x300.jpg 300w, http://localhost/meusite/wp-content/uploads/2016/01/Que-demais-200x200.jpg 200w, http://localhost/meusite/wp-content/uploads/2016/01/Que-demais.jpg 460w" sizes="(max-width: 150px) 100vw, 150px" /></a>
</div>


<div class="item_sidebar">

<img width="150" height="150" src="http://localhost/meusite/wp-content/uploads/2016/01/Gordinho-cansado-150x150.gif" class="attachment-thumbnail size-thumbnail" alt="Gordinho cansado" /></a>
</div>
                <ul>

                    <li id="search-2" class="widget widget_search">
                        <form method="get" id="searchform" class="navbar-form form-inline navbar-left" role="search" action="http://localhost/meusite">
                            <div class="form-group">
                              <input type="text" name="s" id="s" value="" class="form-control" placeholder="Procure">
                              <button type="submit" value="search" id="searchsubmit" class="btn btn-default"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></button>
                            </div>
                        </form>
                    </li>
                    <li id="recent-posts-2" class="widget widget_recent_entries">       
                        <h2 class="widgettitle">Tópicos recentes</h2>
                            <ul>
                                <li>
                            <a href="http://localhost/meusite/Que-demais/">Que demais</a>
                                    </li>
                                <li>
                            <a href="http://localhost/meusite/gordinho-cansado/">Gordinho cansado</a>
                                    </li>
                                <li>
                            <a href="http://localhost/meusite/quase-impossivel/">Quase impossível</a>
                                    </li>
                                <li>
                            <a href="http://localhost/meusite/melhor-fantasia-do-south-park/">Melhor fantasia do South Park</a>
                                    </li>
                            </ul>
                    </li>

                </ul>

                </aside>

            </div>

        </div><!-- Fecha Row-main-->

            <div id="footer" class="row footer text-center">

            <div class="container-fluid volta-topo"><a href="#topo">Volte ao topo</a></div>
                <footer>
                    <nav class="nav navbar-default">
                <main>
                    <p>2016 Meu Site&nbsp;&copy; - Todos os Direitos Reservados.</p>
                </main>
                    </nav>  
                </footer>   
            </div>
        </div>
        <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="http://localhost/meusite/wp-content/themes/tema-meusite/js/jquery-1.11.2.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="http://localhost/meusite/wp-content/themes/tema-meusite/js/bootstrap.min.js"></script>
    <script src="http://localhost/meusite/wp-content/themes/tema-meusite/js/js-humor.js"></script>  

    <script type='text/javascript' src='http://localhost/meusite/wp-includes/js/wp-embed.min.js?ver=4.4.1'></script>


</body>

  • can display the HTML that results from this PHP?

  • Is using some plugin?

  • I put the html at the end of the question. And I’m only using the WP-Pagenavi plugin

  • how is your permalinks configuration?

  • You are set to: /%postname%/ (http://localhost/new9/post-example/)

  • Disable the plugin, reset the permalink settings and try again. This seems to me some conflict

  • I took the plugin, it doesn’t work yet. Very strange right? I will review the whole theme, if you find something, I put here

  • Caio, I downloaded a new wordpress zeroed, using the default theme, and gave the same problem.

  • When I insert a media, in the link to field, I choose the attachment page option, it duplicates the title in the link.

  • Do you use wordpress? It does not happen to you? I am using the English version

  • try deleting your file . htaccess and rebuild the permalinks

Show 6 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.