Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #19809

    hi in another thread, you stated that in order to make a product page full width (without sidebar):

    The image attachment page which is what you linked uses the default “post” template provided by the theme. The theme does not come with a template for the images by itself so you will need to create one that is full width, name it “image.php” and put into the themes main folder on your server.

    You can make a copy of the themes page.php file and remove the sidebar from it as an easy way to do this. is the default image attachment page. WordPress will use the post template if you don’t provide a special template for images. However you can create a special template for images. Eg make a copy of page.php, modify the file (remove the sidebar, etc.) and call it image.php (important, don’t change the name). Then place it into the theme directory where single.php, archive.php, etc. can be found. See also. http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-single-attachments-template-in-wordpress/

    Can you please tell me how exactly to copy the page.php to create a new one called image.php? I believe it is in the Theme Editor but I’m not sure exactly how to do it and I don’t want to mess up the existing files.

    #105126

    Hi,

    as far as I know it’s not possible to create a copy with the default wordpress file editor. Personally I’d use a ftp client (like Filezilla) to access the server directories. Then navigate to wp-content/themes/replete/ and search for page.php. Download this file, rename it to image.php and edit the file content (code). Then upload the image.php file into wp-content/themes/replete/.

    #105127

    This is what we removed from the page.php file and it’s still not working. Please tell us exactly what to remove for the sidebar removal. in like css dummy language please. we are not good at this AT ALL.

    <?php

    //get the sidebar

    $avia_config = ‘page’;

    if(is_front_page()) $avia_config = “frontpage”;

    get_sidebar();

    ?>

    #105128

    it seems like no matter what we delete in the sidebar code, it still shows…please help1

    #105129

    i don’t think the theme (Replete) is recognizing the new file that was created. but it is saved in the correct area you mentioned

    #105130

    Please try to rename it to attachment.php – maybe the mime type detection doesn’t work properly. You can also try to replace:

    get_sidebar();

    with:

    echo "<h1>Works!!!!!!!!!!!!!!!!</h1>";

    If you can’t see this text (Works!!!!!!!!!!!!!!!!) on your attachment page Replete does not use the template file.

    #105131

    thanks, I renamed the file as attachment.php and that didn’t work. I then replaced the text as you mentioned above and the Works!!!!! does not show up on the attachment page. I have the Shop page set to fullwidth (no sidebar) and this works for other pages with no sidebar (such as the about page I created. There is something going on with the Shop/product page that it just keeps showing the sidebar. Can you give any other suggestions? If not, is it possible to eliminate the sidebar completely for the site? We do not use sidebar anywhere except the blog page. thanks so much!!! we want to go live next week and this is one of the last issues!!!

    #105132

    Hi luvhood,

    I see now, the image.php and attachment.php are not for modifying the individual products. Those files are to modify attachments and images.

    What you want can be found in this topic: http://www.kriesi.at/support/topic/disable-sidebar-for-shop-page-keep-sidebar-for-product-categories

    As well as this one for the single product page: http://www.kriesi.at/support/topic/product-details-page-layout

    Regards,

    Devin

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

The topic ‘Creating an Image.php file to overwrite the blog/post’ is closed to new replies.