Tell us what you are trying to do?
I have an account area that I have set up with a section where members can update their posts. There are four different post types - trainer, breeder, stallion, and blog post. I have set up the "Edit this post" for each type and that is working fine. I just want to know what conditional statements I would select so that there would not be blank areas in the layout where the Edit Post link is hidden depending on the post type. You can see what I am trying to describe in the screenshot below. I would like all the Edit Post links at the same position on each card, with the "Delete" link directly underneath it, but I couldn't figure out what conditional options to choose.
Is there any documentation that you are following?
Is there a similar example that we can see?
What is the link to your site?
hidden link
Hello and thank you for contacting Toolset support.
If I understand well, you want to have the "Edit" and "Delete" links close to each other, at the bottom, or just after the title, without having blank space between them, right?
If yes, I must say that the styles are usually affected by the used theme, then by the settings on each block. I'll need to get access to your website to check the view closely. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
Thank you for the credentials. I confirm they are working for me. However, I think, I'll need to create a post to check, right? If yes, please create a couple of posts and make me the authors so I can see them.
Oh sorry, forgot about that. I set it so there is one post or each type. You should be able to see them now.
You are currently using one Fields&Text block for the edit link of each of the 4 post types. So, depending on the type of the current post of the loop, the edit link will be in a different block. So, there will be empty blocks that will cause the blank space, because all blocks will have a <p> tag.
Check this screenshot
I suggest one of the following:
- Use only one Fields&Text block, and put all the edit links shortcodes inside of it. Inside of the same <p> tag.
- Wrap each Fields&Text block inside a conditional block that will check if it is the appropriate post type or not.
- Add the following Javascript to the view. This code will remove empty paragraphs that cause the blank space.
jQuery(function($){
$('.tb-fields-and-text p').each(function(){
var p = jQuery(this)
if( !p.text() ) p.remove()
})
})
Does this make sense? Let me know if you have any questions.
The javascript snippet worked perfectly. My issue is resolved now. Thank you so much!