Hello!
Is there any easy feature to add "New custom post statuses" for custom posts?
Also I need somehow to mark more visually post statuses on every custom post layout on the frontend (textual, by graphic icon or similar)? Please give me some suggestion how can I add in layouts visual mark for post status...
Another question, I need that "Delete" link be visible only for pending status, so how to put a conditional output for such option in my view table?
Thanks in advance for an answer,
Sinisa
Hello, I will answer your questions here. In the future, please create separate tickets for each question, to help keep things organized in the forums. Thanks!
Is there any easy feature to add "New custom post statuses" for custom posts?
Toolset does not offer this feature, so another plugin or custom code will be required.
Also I need somehow to mark more visually post statuses on every custom post layout on the frontend (textual, by graphic icon or similar)? Please give me some suggestion how can I add in layouts visual mark for post status...
You can use the shortcode wpv-post-status to add a specific CSS class to some HTML element, and target that class to set a different background image. Something like this in the HTML tab of a Visual Editor cell:
Post status: <div class="status status-[wpv-post-status]"></div>
Then in CSS:
.status {
height: 100px;
width: 100px;
}
.status.status-publish {
background-image: 'path/to/publish-image.png';
}
.status.status-pending {
background-image: 'path/to/pending-image.png';
}
.status.status-draft {
background-image: 'path/to/draft-image.png';
}
Another question, I need that "Delete" link be visible only for pending status, so how to put a conditional output for such option in my view table?
You can use the "conditional output" button to build this conditional code. In the popup, choose "Views shortcodes" and select wpv-post-status. Type "pending" in the value field. See the screenshot.
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/
Hello Christian,
thanks on your clear answers! It seems very easy with your help... 🙂
I put conditional output for "delete" link, it's working now...
CSS also...
I will find a solution for custom post statuses somewhere else...
Thank You,
Sinisa
P.S. Ok, I will create separate tickets in future for different subjects. Sorry!
Sorry one question more...
How code should looks if I use Bootstrap glyphs for visual marking of statuses from: hidden link
I don't have a clue how to implement them instead CSS and my own images, as you mentioned.
Do I need to use conditional output in that case?
Thanks,
Sinisa
Yes, you can use conditional HTML to display different glyphs based on the post status. You can find a glyph example here:
hidden link
Here is an example of two glyphs in conditionals:
[wpv-conditional if="( '[wpv-post-status]' eq 'pending' )"]
<span class="glyphicon glyphicon-hourglass" aria-hidden="true"></span>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-status]' eq 'draft' )"]
<span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
[/wpv-conditional]
Hi,
Thank You my Guru... ?
Now everything fits and looks easy...
All the best,
Sinisa