• Resolved Reobed

    (@reobed)


    Hello,
    I was wondering if I can use adjust the page of the advert-location listings in such a way that it will pick up the advert location in a text field or so.
    For instance https://loketgevondenvoorwerpen.nl/advert-location/amsterdam/ is just a list of all lost and found items in Amsterdam, with no addiotional text in a header or paragraph. Like :
    This Page shows all lost and found items of the city of <=location>. If you have any questions regaring the lost and found items in <=?Location> please call City Hall.

    Do you have a way of doing this, if so where can I change this ?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Reobed

    (@reobed)

    Kind of almost there : I created a page per town, but somehow I can not let it display the “adverts_location” field by [adverts_list adverts_location=”Amsterdam”], but somehow this does not work, it seems that locations are not queryable via adverts_location shortcode. Right ?

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    the best way to change how the advert location pages look like is to create in your theme directory a file named taxonomy-advert_location.php, similarly as explained here https://wpadverts.com/documentation/child-themes-and-templates/ in the “Custom Taxonomy Template” section.

    You would just need to use different snippets than the one shown in the documentation

    In theme functions.php add

    
    add_filter( "init", function() {
        remove_filter('template_include', 'wpadverts_mal_template_include');
    }, 1000 );
    

    In taxonomy-advert_location.php instead of the_content() use

    
    <?php 
        global $wp_query;
        remove_filter("the_content", "wpadverts_mal_the_content");
        add_filter( "adverts_list_query", "wpadverts_mal_browse_by_location" );
        echo shortcode_adverts_list(array( ));
        remove_filter( "adverts_list_query", "wpadverts_mal_browse_by_location" );
     ?>
    
    Thread Starter Reobed

    (@reobed)

    Thanks. Will try to make it work.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Flexible adjustable tekst fiels’ is closed to new replies.