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

    (@gwin)

    Hi, right now i am afraid the only way to do this would be to remove dates directly from template files.

    Ideally you should create child templates so your changes will not be overwritten on update https://wpadverts.com/documentation/child-themes-and-templates/

    Thread Starter lovefamilyholidays

    (@lovefamilyholidays)

    Ah ok, thanks.

    How do I find the template files please?

    Plugin Author Greg Winiarski

    (@gwin)

    The templates files to edit are wpadverts/templates/list-item.php and single.php, please see that article i linked to its all explained there.

    Thread Starter lovefamilyholidays

    (@lovefamilyholidays)

    Just trying to get my head around this.

    Is there also a way to centre the title text which displays on the adverts list page in each listing?

    Also is there a way to include some kind of call to action button in place of the date, to get the user to click through to the ad?

    Thanks

    Thread Starter lovefamilyholidays

    (@lovefamilyholidays)

    Sorry to ask again.

    I’m pretty confused by all of this.

    I’ve used child themes before (I have one now), but I just can’t work out how I make a child template and where I should put it, or what I should include in it! Basically I’m failing on all levels!

    So do I need to copy the contents of wpadverts/templates/list-item.php (and if so, where should I put the folder/what should it be called? Then do I find the date thingy and delete it from there?

    Then what do I do with the single.php one?

    Sorry, I have read and reread the document over and over and it’s not sinking in. I did the example, but that stuck a date up at the top, so I deleted that folder.

    Would really appreciate your advice, sometimes it takes a while for me to get the hang of things like this!

    Thanks again.

    Plugin Author Greg Winiarski

    (@gwin)

    If you are using this code snippet https://raw.githubusercontent.com/simpliko/wpadverts-snippets/master/override-templates/override-templates.php then you can copy WPAdverts templates from wpadverts/templates/ directory to wp-content/themes/your-current-theme/wpadverts/ directory and the plugin should use those insted of original ones.

    The rest of the article covers customizing different parts of WPAdverts, you seem to only want to customize content fo the templates, so you can use the article i linked to and skip rest of the article.

    Thread Starter lovefamilyholidays

    (@lovefamilyholidays)

    Thank you Greg, I’m finally getting there!

    I’ve managed to remove the dates (hurray!)

    I’m not great with html, so wondered whether you can advise me with this?

    ‘Is there also a way to centre the title text which displays on the adverts list page in each listing?

    Also is there a way to include some kind of call to action button in place of the date, to get the user to click through to the ad?’

    With the call to action, I’d need that to point to each ad it relates to, so I’m really not sure what html to insert for this.

    I’d be very grateful if you could advise?

    Thanks again for the top class support!

    Thread Starter lovefamilyholidays

    (@lovefamilyholidays)

    Sorry one other thing, I can’t seem to find a way to get rid of the ‘About the author’ part at the bottom, is this in a different file?

    Plugin Author Greg Winiarski

    (@gwin)

    1. The about the author most likely comes from your theme single.php or page.php files, to remove it you would need to create a single-advert.php file as explained here https://wpadverts.com/documentation/child-themes-and-templates/ and then remove unwanted elements from this file.

    2. Titles in [adverts_list] you can center by adding following CSS code to your theme CSS file

    .advert-item span.advert-link {
        text-align: center;
    }

    3. inside the list-item.php you can add link like the one below in the place where date used to be

    <a href="<?php the_permalink() ?>">CALL TO ACTION</a>

    although note that the whole item is a clickable area so it does not really make sense to have additional links inside

    Thread Starter lovefamilyholidays

    (@lovefamilyholidays)

    Thank you again for your help with this

    1. I tried to follow the instructions here, created a single-advert.php file and then copied the content from single.php (but wondered how this would work as I already have a single.php in my child themes wpadverts folder). Anyway, I got as far as copying the content fron single.php and uploading it, and it broke my site, so I completely deleted the new single-advert.php file to put it back to normal.

    I can’t see a page.php file, is this what I should be copying the content from instead?

    2. I added the CSS code to the theme’s CSS file, however the changes didn’t happen. Perhaps something within my css is interfering with it? Here’s the contents;

    /*
     Theme Name:     Kyma Child Theme
     Description:    Kyma Child Theme
     Template:       kyma
     Version:        1.0.0
    */
    
    @import url("../kyma/style.css");
    
    /* =Theme customization starts here
    ------------------------------------------------------- */
    /* https://www.itij.co/sites/default/files/u2251/N.EU%20confirms%20flight%20delay%20compensation.SM_.jpg
       https://utazz.ujszo.com/sites/default/files/photos/promoted/keses2.jpg
       https://conversation.which.co.uk/wp-content/uploads/2010/08/airlinedelay_shutterstock_59317648.jpg
       https://davidplusworld.com/wp-content/uploads/2011/11/Flight-delayed.jpg
    
    https://lovefamilyholidays.co.uk/wp-content/uploads/2016/02/london-938880_1920.jpg
    */
    
    .page-id-252 {
       background-image: url('https://lovefamilyholidays.co.uk/wp-content/uploads/2016/02/london-938880_1920-2.jpg') !important;
       background-repeat: repeat !important;
       background-position: top center !important;
    }
    
    }
    .alignleft {
        float: left;
        margin-bottom: .5em;
        margin-right: .5em;
    }
    .alignright {
        float: right;
        margin-bottom: .5em;
        margin-left: .5em;
    }
    .page_title h1 {
      display:none;
    }
    .advert-item span.advert-link {
        text-align: center;
    }
    .advert-item span.advert-link {
        text-align: center;
    }

    3. Thank you for this code. I will work out how to change this to a button. Is there a way to centre this also, or even just move it out of the left hand corner of the ad a notch?

    Thanks again! ??

    Plugin Author Greg Winiarski

    (@gwin)

    1. This really varies from theme to theme, yours might not have the page.php file at all.
    2,3 the code seems fine, you can try to postfix it with !important

    text-align: center !important;

    Thread Starter lovefamilyholidays

    (@lovefamilyholidays)

    Thanks for your reply.

    1. So are you saying I should create a single-advert.php file and then copy the content from single.php (this seems to break the site, plus I can’t see the code to edit) can’t I just edit the single.php in my child themes wpadverts folder?

    This is the content of the single.php in my child theme wpadverts folder;

    <?php
        wp_enqueue_style( 'adverts-frontend' );
        wp_enqueue_style( 'adverts-icons' );
        wp_enqueue_style( 'adverts-icons-animate' );
    
        wp_enqueue_script( 'adverts-frontend' );
    
    ?>
    
    <?php do_action( "adverts_tpl_single_top", $post_id ) ?>
    
    <div class="adverts-single-box">
        <div class="adverts-single-author">
            <div class="adverts-single-author-avatar">
    
            </div>
        </div>
    
        <?php if( get_post_meta( $post_id, "adverts_price", true) ): ?>
        <div class="adverts-single-price" style="">
    
        </div>
        <?php endif; ?>
    </div>
    
    <div class="adverts-grid adverts-grid-closed-top adverts-grid-with-icons adverts-single-grid-details">
        <?php $advert_category = get_the_terms( $post_id, 'advert_category' ) ?>
        <?php if(!empty($advert_category)): ?>
        <div class="adverts-grid-row ">
            <div class="adverts-grid-col adverts-col-30">
                <span class="adverts-round-icon adverts-icon-tags"></span>
                <span class="adverts-row-title"><?php _e("Category", "adverts") ?></span>
            </div>
            <div class="adverts-grid-col adverts-col-65">
                <?php foreach($advert_category as $c): ?>
                <a href="<?php esc_attr_e( get_term_link( $c ) ) ?>"><?php echo join( " / ", advert_category_path( $c ) ) ?></a><br/>
                <?php endforeach; ?>
            </div>
        </div>        
    
        <?php endif; ?>
    
        <?php if(get_post_meta( $post_id, "adverts_location", true )): ?>
        <div class="adverts-grid-row">
            <div class="adverts-grid-col adverts-col-30">
                <span class="adverts-round-icon adverts-icon-location"></span>
                <span class="adverts-row-title"><?php _e("Location", "adverts") ?></span>
            </div>
            <div class="adverts-grid-col adverts-col-65">
                <?php echo apply_filters( "adverts_tpl_single_location", esc_html( get_post_meta( $post_id, "adverts_location", true ) ), $post_id ) ?>
            </div>
        </div>
        <?php endif; ?>
    
        <?php do_action( "adverts_tpl_single_details", $post_id ) ?>
    </div>
    
    <div class="adverts-content">
        <?php echo $post_content ?>
    </div>

    and I can see parts in there referencing authors, but when I try to remove them it seems to break the layout of the adsense on the site. Not sure what I’m doing wrong :/

    2. I’ve added this, but still can’t seem to see any changes. Is this the correct way to add it?

    .advert-item span.advert-link {
    text-align: center;
    text-align: center !important;
    }
    Plugin Author Greg Winiarski

    (@gwin)

    1. you can edit the files in wpadverts directory, but if you do that, remember that all the changes you made will be overwritten on update.

    Also, if copying the files causes an error, then most likely you are copying them from incorrect directory.

    2. your CSS code seems fine to me.

    Thread Starter lovefamilyholidays

    (@lovefamilyholidays)

    1.
    I now know what I was doing wrong with this.

    I was thinking you meant the single.php within the wpadverts folder from the wpadverts plugin, when in fact you meant the theme’s single.php. Sometimes things which would be obvious to one person takes a little longer to understand for me ??

    2.

    I’m putting this css into my theme’s ‘editor’ tab within the wordpress dashboard, is that correct or am I doing that wrong too?

    If you look at my homepage right now you can see that the text ‘CLICK HERE FOR DETAILS’ is actually touching the side of the wpad box, which looks kind of stupid. – lovefamilyholidays.co.uk So it would be good to get this solved.

    I even tried adding some extra spaces using the space bar in the list-item.php file before the CLICK HERE FOR DETAILS text, but to no avail.

    Plugin Author Greg Winiarski

    (@gwin)

    2. Yes, you can do that from wp-admin / Appeareance / Editor panel, for me all data in boxes seem to be centered, only the “Click Here …” text isn’t.

    This is because your HTML tag is outside of <div class="advert-post-title">

    In other words you HTML code seem to be

    <div class="advert-post-title">
        ...
    </div>
    <a href="..." data-wpel-link="internal">CLICK HERE FOR DETAILS</a>

    it should be

    <div class="advert-post-title">
        ...
        <a href="..." data-wpel-link="internal">CLICK HERE FOR DETAILS</a>
    </div>
Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Remove date’ is closed to new replies.