WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Get Post ID

[Resolved] Get Post ID

  • luckybutt
    Member

    @luckybutt

    A very basic thing is missing in this good plugin.
    I cannot find any way by default to get post ID to wrap my div with post ID. I just edited plugin file and added simple code below to get post ID. same like other codes {img} {url} etc…
    But It would be nice if you put it in plugin code , I cannot update plugin because of custom editing.
    And i think it is very basic thing to be added. because wrapping a post in a div with postID is very common thing in wordpress.
    Below are new lines

    add After line 1868

    $postidd = $p->id;

    add After line 1896

    'postidd' => $postidd,

    Edit line to add postidd in list

    $pattern = '/\{(excerpt|summary|stats|postidd|title|image|thumb|thumb_img|rating|score|url|text_title|author|category|views|comments|date)\}/i';

    finally add code after
    array_map(‘strtolower’, $matches[0]);

    if ( in_array("{postidd}", $matches[0]) ) {
    $string = str_replace( "{postidd}", $data['postidd'], $string );
    }

    and then use {postidd} in post_html option of plugin.

    Maybe it helps someone also Please put it in you next release. Thank you

    https://wordpress.org/plugins/wordpress-popular-posts/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.