Display draft posts shortcode without links

  • Unknown's avatar

    Hi, I would like to know if there is a way of using the [display_posts] shortcode to get it to display a list of posts but with the titles not as links. The reason I want to do this is I have a page where I display blog posts that I’m planning to write in the future, which I currently have as drafts.

    I am using the shortcode:
    [display-posts post_status="draft" posts_per_page="30" order="ASC"]

    Obviously I could just have a static list but it is more helpful to me if this can be automatically populated with new draft posts I add and automatically removed when I complete a post and publish it. At the moment when a visitor clicks on a link it goes to a post which isn’t found, so I would like the list not to have clickable links, if this is possible.

    The page is at:
    https://aprescriptionforme.wordpress.com/article-ideas-for-my-blog/

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi crochetkid75!

    I do not believe that this is an option with the current Display Posts Shortcode.

    However, you might be able to change the link behavior with CSS if you have Custom CSS available to you.

    .display-posts-listing li.listing-item {
       pointer-events: none;
       cursor: default;
    }

    I’ve never actually used this CSS before, but it looks like it works. Heck, I’m not even sure it works in all browsers. I also would not mind if someone else would verify that it works.

  • Unknown's avatar

    Unfortunately I just have a basic .com blog so custom CSS isn’t an option for me but thanks for replying. I will have to be less lazy and have a static list that I update I think!

    Thanks again, Emily

  • The topic ‘Display draft posts shortcode without links’ is closed to new replies.