Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1230629

    Hi all,

    I need you help figuring out the following:

    • I made some layout changes the post entries by author. But i have an issue really strange. We have some posts that have the format as “link”. They work fine (open the external link) until i add the Excerpt.
      After adding the Excerpt the link goes to the post it self.
    • How can i add the featured post image here. Can you help?

    Thanks for the help

    • This topic was modified 4 years, 4 months ago by kylerollins.
    #1231592

    Hey Kyle,
    Sorry for the late reply, when using the “link” post type they link to different pages with their headline. Please include an admin login in the Private Content area so we can see how you are adding the excerpts and investigate this issue.

    Best regards,
    Mike

    #1231759

    Hi Mike,

    Thanks for the help!
    The excerpt is added in the normal excerpt field.

    Cheers

    #1232029

    Hi,
    Thanks for the login, I see that if you add the excerpt to the excerpt field the title doesn’t link correctly, but if the excerpt is in the post field the link is correct.
    I can not recreate this on a new install, I see you have a plugin “Page Links To” perhaps this is related to it.
    Please check your page now that I adjusted the excerpts.

    Best regards,
    Mike

    #1232047

    Hi Mike,
    Thanks for the quick replay.

    I tried to disable the plugin “Page Links To” and test it. but it seams the issue is still there.

    I will need to use the excerpt in the post field, because the client uses custom excerpts. I changed back the excerpt so we can test it.
    Also if you go to link1, we have the same posts (with the excerpt in the post field, and other without ) and both work fine. The issue is only on the author post page (link2)

    Maybe is a small fix on the author loop page

    Thanks for your help
    Cheers

    #1233022

    Hi,
    Sorry for the late reply, and thanks for your feedback, indeed the post type “link” is not working as expected on the author archive page. In my tests with a clean install the post type “link” on the author archive page doesn’t link to the external link such as the category & tag archive pages, but it doesn’t matter where the excerpt is placed, in the excerpt field or in the post field.
    link-post-type.jpg
    So I’m not sure why on your install it seems to matter where the excerpt is placed, perhaps it is related to some of your other customizations, but I believe the first step is to get the “link” post type to work on the author page for a clean install and then see how the excerpts behave on your install.
    I was not able to correct this so I submitted a request to the dev team to review. I will update this thread when the dev team replies. Thank you for your patience.

    Best regards,
    Mike

    #1236465

    Hey Mike,
    do you have any news on this?

    Thanks

    #1236961

    Hi,
    Unfortunately, the dev team says this is not a bug, but an expected result of how “get_the_excerpt()” removes links from the content, and changing this breaks other functions. Please see below for full notes.
    How many “link” type posts do you plan on showing on your author page? I’m thinking if there is only a couple I may be able to write a script that will add the links, otherwise, this may require an author.php rewrite to achieve your goal.

    Best regards,
    Mike

    #1237035

    Hi Mike,

    Thanks for replaying and trying to figure out.

    If i understand correctly, we have a category called “news” and some of the post there are post type as “link”. So there are not a loot.
    Let me know if this help you write the small script.

    Thank you again for the help

    Cheers

    #1237825

    Hi,
    Thank you, I checked your “news” category and found only one “link” type post, except for the two test posts.
    So for the author page we will target post-entry-6313 and change the URL only on the author page with this script.
    Please adjust the URL in the script to the one in the Private Content area.
    Try adding this code to the end of your functions.php file in Appearance > Editor:

    function custom_author_link_type_link(){
      ?>
      <script>
    (function($){
      $(window).load(function(){
      $("#top.archive.author .post-entry-6313 h2.post-title.entry-title ").find("a[rel='bookmark']").attr("href", "https://www.google.com");
      });
      })(jQuery);
      </script>
    <?php
    }
    add_action('wp_footer', 'custom_author_link_type_link');

    This can be extended in the future if you add more link type posts.

    Best regards,
    Mike

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.