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

    (@imaguard)

    Thanks for your kind words about the plugin.

    I am not sure exactly what you mean re custom templates. Imaguard as a plugin works with most WP templates – it simply grabs the template style and uses that for the image display.

    Thread Starter muhammadwaqas

    (@muhammadwaqas)

    Yeah its working. But I wanted to use a custom template,for example, imaguard.php (without widgets and ads)to show images.

    Currently images are appearing on a normal page with everything on it.

    Plugin Author imaguard

    (@imaguard)

    > Currently images are appearing on a normal page with everything on it.

    Yes that was the point, really ?? A lot of people wanted to display the image inside the blog layout to capture the visitors. If you want to use Imaguard with specific areas of your template turned on or off, you would have to play around a bit with your template page.php file (or one of the page parts it calls through an include).

    Then in this section of plugins/imaguard/index.php you could set a value like $post->layout = ‘no-side-bar’:

    $post = new stdClass;
    		$post->post_author = 1;
    		$post->post_name = get_option('ir_page_slug');
    		$post->guid = get_bloginfo('wpurl') . '/' . get_option('ir_page_slug');
    		$post->post_title = get_option('ir_page_title');
    		$post->post_content = ir_newcontent();
    		$post->ID = -1;
    		$post->post_status = 'static';
    		$post->comment_status = 'closed';
    		$post->ping_status = 'open';
    		$post->comment_count = 0;
    		$post->post_date = current_time('mysql');
    		$post->post_date_gmt = current_time('mysql', 1);
    		$post->layout = 'no-side-bar';

    And then in your page.php file you include something like

    if ($post->layout != 'no-side-bar') {
      // here goes your page widget area
    } else {
      // here is what to do if there is no widget area
    }

    Sorry for the very general explanation, but it is very much up to the template you are using.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can we use custom template?’ is closed to new replies.