Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author imaguard

    (@imaguard)

    Sure, this is no problem. We will add it to a future version.

    For now, simply replace this line of your imaguard.php:

    $post->post_title = get_option('ir_page_title');

    with

    $post->post_title = ir_getposttitlebyurl($_GET['img']);

    and then add this function somewhere in the file, f ex between these two lines “add_filter(‘the_posts’,’ir_detectpost’);” and “function ir_createpage()” so you get

    (...)
    add_filter('the_posts','ir_detectpost');
    
    function ir_getposttitlebyurl($url) {
    	global $wpdb;
    	$query = "SELECT ID FROM {$wpdb->posts} WHERE guid like '%".$url."'";
    	$thisid = $wpdb->get_var($query);
    	$postdata = get_post($thisid);
    	return $postdata->post_title;
    }
    
    function ir_createpage()
    (...)
    Plugin Author imaguard

    (@imaguard)

    Marking this as solved but don’t hesitate to post again if you have a problem implementing the code…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Is it possible to show Image Name in Title instead of view image’ is closed to new replies.