• Resolved rancidbutcher76

    (@rancidbutcher76)


    Hi Greg

    I would like to create a custom version of the single advert page as it currently appears to be using the blog post template including a side bar. My idea is to set up an entirely custom page, without a side bar and one which can be edited without affecting the blog posts.

    What I would like is the images to be on the left and the advert details to appear on the right, beside the images. Also, the main images would ideally be portrait and not landscape as it will sit better this way. Not dissimilar to how the adverts appear on this site:

    https://ie.boohoo.com/polka-dot-smock-dress/FZZ69554.html?color=133

    We are using wp-adverts for selling clothes so the idea remains the same.

    I’ve edited the frontend css on the .wpadverts-slide class to increase the height of the images and this works but I’m unsure if this is the best way of changing the layout.

    Any help you can provide for the creation of a custom single advert page would be most appreciated.

    Thanks!

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

    (@gwin)

    Hi,
    the best way to create a custom view for the Ad details page is to add in your theme folder a file named single-advert.php and copy to it content from page.php or single.php and customize, more details about it you will find here https://wpadverts.com/documentation/child-themes-and-templates/ in “Custom Post Type Template” section.

    You can move the images to the right with CSS or create a child-template file for the wpadverts/templates/single.php file and the customize the HTML to your needs (also explained in the article linked above).

    Regarding changing the image sizes please see https://wpadverts.com/documentation/custom-image-sizes/

    One note about CSS changes, it is best to overwrite the default CSS rules by adding new rules in wp-admin / Appearance / Customize / Additional CSS panel, the changes you do in adverts-frontend.css file will be overwritten on each WPAdverts update.

    Thread Starter rancidbutcher76

    (@rancidbutcher76)

    Perfect, thanks that worked really well. The only issue I found is that overwriting the CSS rules doesn’t seem to work. For example I’ve added these rules:

    .wpadverts-slide img {
    height: 750px;
    }

    .wpadverts-slide-img{
    height:750px;
    }

    in the ‘Additional CSS’ customizer and they don’t affect anything. Editing the wpadverts-frontend.css obviously works but I realise it’s not ideal. Is there anything that I might need to do to get the additional rules to take effect?

    Plugin Author Greg Winiarski

    (@gwin)

    The two rules you created will be basically ignored as the rules in adverts-frontend.css take precedence, try postfixing all the values with !important keyword like this

    
    .wpadverts-slide img {
       height: 750px !important;
    }
    .wpadverts-slide-img{
        height:750px !important;
    }
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Creating a custom single advert page’ is closed to new replies.