• Resolved Simon Harvey

    (@s_t_harvey)


    Hello, this is a great plugin, thanks so much for your hard work.

    Is it possible for the latest forum posts plugin to show an excerpt of the post content? At the moment it seems to just show the topic title.

    Thanks.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Asgaros

    (@asgaros)

    Hello @s_t_harvey

    At the moment I dont plan to add an excerpt to the latests posts/topics widget because it could possible break the design – for example when a post would start with a big image.

    If you want I could add some additional hooks which allows you to add custom content to the widgets. In this case I could provide a piece of code which would do the job with the next update of Asgaros Forum. Please let me know if you are interested in this – but as I said before, there is still the risk that it could break your design.

    Thread Starter Simon Harvey

    (@s_t_harvey)

    Thanks for getting back to me!

    I would very much be interested in this. I was going to look to write my own widget that did it but if there was one built into Asgaros that would be incredible.

    I was wondering about filtering the excerpt to remove HTML tags so that just plain text remains – that way the risk of images causing a problem could be reduced?

    Maybe it could get the entire post content, then remove HTML tags, and then return the first 50/100 characters?

    Thanks again for your hard work.

    Plugin Author Asgaros

    (@asgaros)

    Hello again @s_t_harvey

    The upcoming version which I release in the next hours will contain the following two new hooks:

    – asgarosforum_widget_recent_posts_custom_content
    – asgarosforum_widget_recent_topics_custom_content

    You can use them to add some custom content. For custom queries to select the post-text you can use the element_id which is given as a parameter:

    function widget_custom_content($element_id) {
      echo 'My custom content: '.$element_id;
    }
    add_action('asgarosforum_widget_recent_topics_custom_content', 'widget_custom_content', 10, 1);
    add_action('asgarosforum_widget_recent_posts_custom_content', 'widget_custom_content', 10, 1);
    Thread Starter Simon Harvey

    (@s_t_harvey)

    Ok wow, thanks so much, that was quick!

    I’ll keep an eye out for the update and then add something then.

    Thanks again for a great plugin.

    Simon

    Greeting

    I need the forum date not to appear, can something be done?
    Thanks

    Plugin Author Asgaros

    (@asgaros)

    Hello @marciagomez

    You can hide it with the following css-code:

    .asgarosforum-widget .post-date {
        display: none !important;
    }
    Thread Starter Simon Harvey

    (@s_t_harvey)

    Hello again,

    That’s great, I have used the hook and it is working great ??

    Is there a simple way in PHP to get the URL of a specific forum post using it’s ID?

    Thanks,

    Simon

    • This reply was modified 6 years, 5 months ago by Simon Harvey.
    Thread Starter Simon Harvey

    (@s_t_harvey)

    Hello,

    I have written a script that creates a 200 character preview of the post (and accounts for images) – https://www.educateoutside.com/forum/

    I just need to figure out how to generate a link using the forum post ID – do you have any advice?

    Thanks

    Thread Starter Simon Harvey

    (@s_t_harvey)

    Sorry, posted that a bit prematurely – I have figured out how to construct a forum post URL (not search engine friendly).

    Thanks again for a great plugin.

    Thank you very much for your excellent service

    Plugin Author Asgaros

    (@asgaros)

    Hello @s_t_harvey

    There is a function which you can use to get the URL when the ID of a post is given:

    global $asgarosforum;
    $url = asgarosforum->rewrite->get_post_link(123);
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Latest Post Widget’ is closed to new replies.