This topic has 3 replies, 2 voices, and was last updated 6 years by Kieran_SQ.

  • Author
  • #196940
     gimelk
    Participant

    Is there a way to add a publish button to the frontend of posts? I saw a couple sites give codes for it to work on their themes so I’m thinking there must be a way for it to be done on kleo. I would like it to be available for users with the roles of authors to administrators.

    #196951
     Kieran_SQ
    Moderator

    Hi,

    I do not 100% understand your question. Do you wish users to publish from the front-end instead of the back-end? If so please install and configure Social Articles from the WordPress.org plugin repository as we already have compatibility with the plugin.

    If you mean something else please let me know where you would like the button to appear and where you like the button to send users who have the role of Author or Administrator.

    Thanks,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #196981
     gimelk
    Participant

    Hi, my apologies for being so vague with my description. Currently when a post is made it goes in a pending status. This can be approved in the backend by an administrator clicking the publish button if they go to the post. What i’ve done is that I’ve created a page in the frontend where you can go and see a list of all the pending posts. you can click and open the post just as if it’s a normal blog post, however, it is not yet published to the site and can only be seen by people with the ability to see this page. Here is a link that basically explains what I’m looking for “https://premium.wpmudev.org/blog/how-to-add-a-publish-button-to-the-frontend-of-your-wordpress-posts/” The goal is to be able to embed a publish button on all pending posts single pages so that they can be approved from the front end by anyone with the administrative rights to do so.

    #197048
     Kieran_SQ
    Moderator

    Hi,

    You would need to extend the custom code you already have in place to show the button for each of the unpublished posts. We can’t help you with the code via the forum as it outside the scope of support we provide with the theme.

    Once you have created your custom code for single posts you can add it to an area of the KLEO theme like so

    COPY CODE
    // Add custom publish button to main content in single post if role is admin or editor
    add_action('kleo_before_content','add_publish_button_for_posts');
    function add_publish_button_for_posts() {
        if ( is_singular( 'post' ) && current_user_can( array('administrator', 'editor')) ) {
            // YOUR CODE HERE
        }
    }

    You can alter the position of where it is rendered by changing kleo_before_content to any of our hooks which you can find in the documentation here https://archived.seventhqueen.com/documentation/kleo under the heading ‘Theme Hooks’.

    Thanks,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?