Listing Help

  • Author
    Posts
  • agusmendez89

    Hi people!
    Im creating a site but i want to change 2 things:
    1st and more important –> How can i put not to show every atribute on the listing? I only want to show 4 (the most important)
    The second is how can i change the url /listing/ to another word?
    Thanks!

    condorito

    Sure,
    All you need to do is update the permalink for your current “listings” page.

    condorito

    Sorry, you were talking about the detail listing page…
    I haven’t a clue.

    ihordeveloper

    Hi,

    1. You can assign any attribute to different display areas of the listing in the “Display” section when you edit an attribute. If you don’t assign it to any area then it’ll be hidden.

    2. Please try using this code snippet, and refresh permalinks after you add it:

    add_filter(
    	'hivepress/v1/post_types',
    	function( $post_types ) {
    		$post_types['listing']['rewrite']['slug'] = 'custom-slug-here';
    
    		return $post_types;
    	}
    );
    condorito

    Hello Ihor,
    Once again, you came about with a nice and sleek solution.
    Though I am not new to WP or development, I am not used to this way of customizing a project (adding / editing current attributes of an object) to suit our needs.
    So you use a filter & action hook, but is there a way to know more about what can be done, besides fumbling in the code and going trial-and-error process ? Something more like an API specific to this project, so that we could do the changes without asking you all the time ? The “references” section (https://hivepress.io/docs/references) is a good starting point, but it’s still mysterious to me, and as far as I can tell, to many of us.

    Thank you.

    ihordeveloper

    Sure, I plan to add the developer docs (there’re just references at the moment) and tutorials. HivePress has an intuitive hooks API (actions and filters), so you can customize basically anything. For example, if you want to change some config check the file in this folder https://github.com/hivepress/hivepress/tree/master/includes/configs and use the “hivepress/v1/config_name_here” filter to change it (like this example with post types above). The same works with forms, templates, menus, etc.

    PS. Thanks for your answers on other topics, I’m handling support by myself at the moment so this really helps.

    agusmendez89

    Thnaks for the answers and sorry my ignorance.. Where should i put this code?
    add_filter(
    ‘hivepress/v1/post_types’,
    function( $post_types ) {
    $post_types[‘listing’][‘rewrite’][‘slug’] = ‘custom-slug-here’;

    return $post_types;
    }
    );

    condorito

    In the function.php file or preferably in a custom-made plugin.

    agusmendez89

    Thanks!

    bayanm

    I tried to change the add listing button name with the same code in function.php but then I received a debug error when opening the WP dashboard

    ihordeveloper

    @agusmendez89 You can also use this plugin for adding code snippets https://wordpress.org/plugins/code-snippets/ Changes in functions.php may be erased on ListingHive update.

    @bayanmThis code doesn’t change the button caption, just the URL slug. Please try using this plugin for changing static texts without code changes https://wordpress.org/plugins/loco-translate/

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

You must be logged in to reply to this topic.

Subscribe

Sign In

Don't have an account? Register

Forgot password?

Register

Already have an account? Sign In

Forgot password?

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.