Home Support Themes ListingHive need help with the template

need help with the template

  • Author
    Posts
  • SERblY

    Good afternoon! Please tell me! In what file should I change the html markup of the main page and other templates ?

    ihor developer

    Hi,
    Please edit the Home page in WordPress/Pages section, you can edit its layout via adding/removing blocks like any other WordPress page. Pages generated by HivePress (like the listing or vendor page) can be customized only via the custom CSS/PHP snippets.

    SERblY

    no, I’m not talking about this, how do I edit the code itself, for example, I want to make minimal changes to the html grid, the code is open to you, through the admin panel this can not be done!

    SERblY

    what file? in which folder on the server should I edit ?

    Steven

    @SERblY unless I am mistaken, your trying to edit html in a file which does not actually exist, the home page is just a wordpress page, with modules included into it, within the wordpress admin

    the best you can do, is to logon as admin, click the edit page button, click teh section you want to edit, and then change the modules or section options, in the case of the categories or posts, you can change the column counts or row counts

    after this then you have to add code snippets to over-ride the std default settings or to add custom css into the /templates customize page, to over-ride the std default css settings

    Thanks

    SERblY

    well, for example, a fragment of the code of the feedback output block on the main page
    <div class="hp-row"><div class="hp-grid__item hp-col-sm-4 hp-col-xs-12"><div class="hp-review hp-review--view-block"><header class="hp-review__header"><div class="hp-review__image">
    I want to change
    hp-col-sm-4
    hp-col-sm-6
    there are no such settings in the admin panel, and much could be changed to customize the appearance of the template, but it is not clear where, it is at least not convenient, at least tell me in which file it can be corrected!

    ihor developer

    Please be patient and remember that it’s open-source software, and you get support from the community.
    There’s no single file for everything in some specific location. If you want to override some template part, you can locate it here https://github.com/hivepress/hivepress/tree/master/templates then copy and place it inside the child theme’s “hivepress” subfolder, keeping the same file path. Then your copied template part will override the default one, and you’ll be able to customize it in any way. It works similarly to WooCommerce (the only difference is that they require a “woocommerce” subfolder).
    If you mean overriding the whole page structure, you can try customizing it with CSS or even override it via hivepress/v1/templates/ hooks (please search for code samples on the forum).

    ihor developer

    If you mean changing the number of columns for the reviews on the home page then code customizations are not required, you can simply edit the Home page in WordPress/Pages section, select the Reviews block in the editor and change the number of columns in the block settings on the right.

    Steven

    @SERblY

    I think your going to start bumping into my own pet hate with the template, in that you cannot change the # pf the col css, so the only way you can do what you want is to start over-riding the natural way that the col-# is designed to work, by forcing the % to the one you want

    I think this should work, and make the col-4 act like a col-6

    .hp-grid__item .hp-col-sm-4 {
    -ms-flex-preferred-size: 50%;
    flex-basis: 50%;
    max-width: 50%;
    }

    But this can have odd effects on way pages work, example, is that on a phone, you may actually require the hp-col-sm-4 to also be 100% instead of the 50% to emulate the col-6

    Its not very friendly, and you can easily end up in a twist with loads of odd css, and basically fighting yourself

    It cannot be fast enough that an actual customizable theme is released for Listings, with some settings for the std default pages, at different media screen widths, and attributes that can be clicked to show or hide on similar screen widths

    SERblY

    yes, that’s what I wanted to say, when you change the css style, these properties will change everywhere, so I asked where to change the attribute itself in the html code. col-4 col-6 col-12 and so on!

    SERblY

    If you mean changing the number of columns for the reviews on the home page then code customizations are not required, you can simply edit the Home page in WordPress/Pages section, select the Reviews block in the editor and change the number of columns in the block settings on the right.

    yes, everything that is on the main page can be configured via the admin panel, but for example, the output of the list of ads on the mrubriki page can no longer be configured, and I, for example, would like them to be released col-12 and so on, what about this?

    SERblY

    which files in the child theme should I edit ?

    SERblY

    <div class="hp-grid__item hp-col-sm-6 hp-col-xs-12"><article class="hp-listing hp-listing--view-block"><header class="hp-listing__header"><div class="hp-listing__image">
    which files in the child theme should I edit ?

    <div class="hp-grid__item hp-col-sm-4 hp-col-xs-12"><article class="hp-listing hp-listing--view-block"><header class="hp-listing__header"><div class="hp-listing__image">

    which files in the child theme should I edit ?
    I want to change hp-col-sm-6 to hp-col-sm-12, and hp-col-sm-4 to hp-col-sm-12

    ihor developer

    This depends on the required customizations. For example you can use this code snippet to change the number of columns on the listing pages https://hivepress.io/support/topic/add-one-or-two-columns-in-categories/#post-6469 If you want to override some specific template parts (not the layout structure) please follow the suggestions above about a child theme. You can also customize the styling via CSS, and use unique CSS classes (then your tweaks will not affect all layouts) – each page or block has one.

    SERblY
    add_filter(
    	'hivepress/v1/templates/listings_view_page',
    	function( $template ) {
    		return hivepress()->helper->merge_trees(
    			$template,
    			[
    				'blocks' => [
    					'listings' => [
    						'columns' => 3,
    					],
    				],
    			]
    		);
    	}
    );

    Great! just what you need! Thanks!
    and tell me another snippet to change the same number of columns only for Similar ads

    ihor developer

    You can try using this one:

    add_filter(
    	'hivepress/v1/templates/listing_view_page',
    	function( $template ) {
    		return hivepress()->helper->merge_trees(
    			$template,
    			[
    				'blocks' => [
    					'related_listings' => [
    						'columns' => 3,
    					],
    				],
    			]
    		);
    	}
    );
    SERblY

    Great! just what you need! Thanks!

    SERblY

    I want to display the advertised ads in a carousel on the main page, for example:
    <div class="item"> ................</div>
    what code can I use to display a selection of advertised ads ?
    or maybe with the help of some snippet or some other methods there are ?
    Thanks! I hope for your help

    ihor developer

    Sorry, but customization is not part of support (it includes fixing bugs and general guidance about the HivePress features). You can try using the existing Listings block/shortcode and turn it into a carousel via JS. For example there’s a carousel in other HivePress themes https://taskhive.hivepress.io/ Or you can consider using this block/shortcode without a carousel and display ads in a few rows.

    SERblY

    Good evening! OK, I’ve set up a widget to display ads in 4 columns, 10 ads in total, show only the advertised ones.And how do I pull this construction out now in the code to wrap it in a JS carousel ??? Please tell me!

Viewing 20 posts - 1 through 20 (of 21 total)

You must be logged in to reply to this topic.