simpliko

simpliko supports this item

Supported

146 comments found.

Is this the same as https://en-ca.wordpress.org/plugins/wpadverts/ ???

Pre-sale purchase. If I buy this plugin, what adds on are included? Or are they selling separately?

Thank you

Ok, like many I was looking to adjust the category and slug of the events permalink structure, I was successful using these 2 pieces of code.

/* * Customize advert post type slug * * @link https://github.com/simpliko/wpadverts-snippets/blob/master/custom-slugs/custom-slugs.php */ add_action( ‘adverts_post_type’, ‘customize_adverts_post_type’ ); function customize_adverts_post_type( $args ) { }

if ( ! isset( $args["rewrite"] ) ) {
  $args["rewrite"] = array();
}
  1. adverts_post_type hook is used for multiple post types, we only want to affect ‘advert’ if ( ( ! isset( $args[‘taxonomies’] ) ) || ( ! in_array( ‘advert_category’, $args[‘taxonomies’] ) ) ) { $args“rewrite” = false; return $args; }
$args"rewrite" = "classifieds/ advert_category ";
$args"rewrite" = false;
$args"rewrite" = false;
$args"rewrite" = false;
return $args;

/* * Customize advert_category taxonomy slug * * @link https://github.com/simpliko/wpadverts-snippets/blob/master/custom-slugs/custom-slugs.php / add_action( ‘adverts_register_taxonomy’, ‘customize_adverts_taxonomy’ ); function customize_adverts_taxonomy( $args ) { if ( ! isset( $args[“rewrite”] ) ) { $args[“rewrite”] = array(); } }

$args"rewrite" = "classifieds";
$args"rewrite" = false;
$args"rewrite" = false;
$args"rewrite" = false;
return $args;

/* * Expand advert_category in permalink structure. * * Adapted from http://shibashake.com/wordpress-theme/add-custom-taxonomy-tags-to-your-wordpress-permalinks / function customize_adverts_category_permalink( $permalink, $post_id, $leavename ) { if ( strpos( $permalink, ‘ advert_category ’ ) === FALSE ) return $permalink; } add_filter( ‘post_type_link’, ‘customize_adverts_category_permalink’, 10, 3 );

// Get post
$post = get_post( $post_id );
if ( ! $post ) return $permalink;
// Get taxonomy terms
$terms = wp_get_object_terms( $post->ID, 'advert_category' );
if ( ! is_wp_error( $terms ) && ! empty( $terms ) && is_object( $terms[0] ) ) {
    $taxonomy_slug = $terms[0]->slug;
} else {
    # we can't just remove the slug or the post name is matched as
    # a category name and we get a not found error
    #return str_replace( ' advert_category /', '', $permalink );
}
  1. try to default to first category in the taxonomy $terms = get_terms( array( ‘taxonomy’ => ‘advert_category’, ‘hide_empty’ => false, ‘orderby’ => ‘term_id’, ) ); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) { $taxonomy_slug = $terms0->slug; } else { # default category slug $taxonomy_slug = ‘for-sale’; }
return str_replace( ' advert_category ', $taxonomy_slug, $permalink );

/* * Set default advert_category for adverts. * * This function sets a default category for any advert if unset * (match the default category set in the permalink above). / function customize_adverts_default_category( $post_id, $post, $update ) { $slug = ‘advert’; if ( $slug != $post->post_type ) { return; } } add_action( ‘save_post’, ‘customize_adverts_default_category’, 10, 3 );

$terms = get_terms( array(
    'taxonomy' => 'advert_category',
    'hide_empty' => false,
    'orderby' => 'term_id',
) );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
    wp_set_object_terms( get_the_ID(), $terms[0]->term_id, 'advert_category' );
}

/* * Add rewrite rules for adverts url structure. / add_action( ‘init’, ‘customize_adverts_rewrite_rules’ ); function customize_adverts_rewrite_rules() { global $adverts_rewrite_rules_added; $adverts_rewrite_rules_added = 0;

  1. force flush_rules() for testing (FIXME: disable for production!!!) if ( 1 ) { global $wp_rewrite; $wp_rewrite->flush_rules(); }
    1. rewrite rule for per-category feed
    #
  2. the generated feed isn’t right (the containing each
  3. advert title is outside the link), disabled until fixed. #
  4. add_rewrite_rule(
  5. ‘classifieds/([/]+)/(feed|rdf|rss|rss2|atom)/?$’,
  6. ‘index.php?advert_category=$matches1&feed=$matches2’,
  7. ‘top’
  8. );
  9. $adverts_rewrite_rules_added++;
    1. todo: add rule for classifieds/feed (all categories)
    1. rewrite for individual advert add_rewrite_rule( ‘classifieds/([/])/(.)/?$’, ‘index.php?advert=$matches2’, ‘top’ ); $adverts_rewrite_rules_added++;
    1. rewrite for category #
    2. The ‘add’ and ‘manage’ pages would be masked by this rewrite,
    3. so we exclude those in the regex: (?!add|manage) #
    4. get post object for ‘Default Ads List Page’ set in wpadverts options if ( function_exists( ‘adverts_config’ ) ) { $post = get_post( adverts_config( ‘config.ads_list_id’ ) ); } else { $post = get_page_by_path( ‘classifieds’ );

      if( is_null( $post ) ) { $post = get_post( 3917 ); # actual page id via manual lookup }

      }

    $add_post = null; $manage_post = null;

    1. get post object for ‘add’ and ‘manage’ pages if( ! is_null( $post ) ) { $add_post = get_page_by_path( $post->post_name . ’/’ . __( ‘add’ ) ); if( is_null( $add_post ) ) { $add_post = get_post( 3918 ); # actual page id via manual lookup }

      $manage_post = get_page_by_path( $post->post_name . ’/’ . __( ‘manage’ ) ); if( is_null( $manage_post ) ) { $manage_post = get_post( 3919 ); # actual page id via manual lookup }

      }

    $exclude = ‘feed|rdf|rss|rss2|atom’;

    if( ! is_null( $add_post ) ) { $exclude .= ’|’ . $add_post->post_name; } else { $exclude .= ’|add’; }

    if( ! is_null( $manage_post ) ) { $exclude .= ’|’ . $manage_post->post_name; } else { $exclude .= ’|manage’; }

    add_rewrite_rule( ‘classifieds/((?!’ . $exclude . ‘)[/]+)/?$’, ‘index.php?advert_category=$matches1’, ‘top’ ); $adverts_rewrite_rules_added++;

}

/* * Clean up rewrite rules. */ add_filter(‘rewrite_rules_array’, ‘customize_adverts_cleanup_rewrite_rules’); function customize_adverts_cleanup_rewrite_rules( $rules ) { global $adverts_rewrite_rules_added; $cnt = 0; } The only problem now is that pages I made children of my main classifieds page are now showing a 404.

foreach ( $rules as $rule => $rewrite ) {
  1. remove rewrite rules containing ‘ advert_category ’. if ( strpos( $rule, ‘ advert_category /’) !== false ) { unset( $rules[$rule] ); continue; }
  1. remove all default rules—no, this kills adverts-payment rules #if ( strpos( $rule, ‘classifieds/’) === 0 && $adverts_rewrite_rules_added <= $cnt++ ) {
  2. unset( $rules[$rule] ); #}
  1. remove conflicting default rule if ( $adverts_rewrite_rules_added <= $cnt++ && strpos( $rule, ‘classifieds/([/]+)/?$’) === 0 ) { unset( $rules[$rule] ); }
}
return $rules;

My main page is: http://inthebunch.co.za/classifieds/ And one of the 404 pages is: http://inthebunch.co.za/classifieds/post-an-ad/

We cannot post an ad bc while there is a container for description but no way to add text. You can see the description field, but cannot click into the box or type in it. We purchased the plug in hoping that it would fix this issue and it still doesn’t work! Here’s a screenshot of what it looks like: http://bearzmountain.com/wp-content/uploads/2017/05/wp-advert.jpg

Hi! Is custom fields add-on included into this version of plugin?

Hello,

I’m looking at purchasing this plugin and wanted to know if it would work with my BuddyBoss theme? It uses buddypress, obviosuly, but would it just offer an option on the users drop down menu to post an advert and buyers can message them in their inbox?

Thank you.

Does this plugin contains all the extension bundle mentioned at: https://wpadverts.com/extensions/all-extensions-bundle/

by
by
by
by
by
by