Forum Replies Created

Viewing 15 replies - 46 through 60 (of 66 total)
  • Thread Starter dalemoore

    (@dalemoore)

    Figured it out.

    if (is_product_category()){
        global $wp_query;
        // get the query object
        $cat = $wp_query->get_queried_object();
        // get the thumbnail id user the term_id
        $thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true );
        // get the image URL
        $image = wp_get_attachment_image( $thumbnail_id, 'feature-image' );
        // print the IMG HTML
        echo $image;
    
    }

    Not a fan of this, though, because I can’t control the crop. So, I am back to needing to upload two thumbnail images in the Category…

    Thread Starter dalemoore

    (@dalemoore)

    Actually I found this code from here: https://docs.woothemes.com/document/woocommerce-display-category-image-on-category-archive/

    add_action( 'woocommerce_archive_description', 'woocommerce_category_image', 2 );
    function woocommerce_category_image() {
        if ( is_product_category() ){
    	    global $wp_query;
    	    $cat = $wp_query->get_queried_object();
    	    $thumbnail_id = get_woocommerce_term_meta( $cat->term_id, 'thumbnail_id', true );
    	    $image = wp_get_attachment_url( $thumbnail_id );
    	    if ( $image ) {
    		    echo '<img src="' . $image . '" alt="" />';
    		}
    	}
    }

    but I can’t figure out where in there I can set my custom size for it, a different size than listed in WooCommerce Settings > Catalog at the bottom. I’ve created a custom size called ‘feature-image’ in my functions.php using add_image_size. If I can have it just use that image that gets generated I guess I wouldn’t need a second image upload…?

    You have to add the code in your theme yourself. Or, if inserting the links into a widget area, use the My Link Order widget instead of the regular widget.

    You type the Link ID into the Include Category field. You can see the ID # by hovering over the link in Links > All Links. In the URL at the end it’ll say &link_id=number-here

    Thread Starter dalemoore

    (@dalemoore)

    Thanks, vtxyzzy! Your solution works perfectly.

    Thread Starter dalemoore

    (@dalemoore)

    Thanks, Matty. Much appreciated!

    Thread Starter dalemoore

    (@dalemoore)

    Yeah, I know. I don’t need convincing it’s a dumb idea, but the client wants it done and isn’t budging. They have been told it’s not possible to completely prevent, but they want it at least made difficult for the average tech-illiterate person, which is pretty much every customer of theirs. The content images they want to not be savable isn’t publicly visible, it’s behind a password-protected area and access is only granted to their customers.

    I have implemented a solution of my own using div overlays with a transparent background, and some custom JS on the Fancybox pop-ups. This is solved.

    The slug for the page was created by TML, and it’s “log-in”. I guess because it gives the page the name “Log In” instead of “Login” like it used to. I changed slug to “login” just now, logged out, and tried logging back in and it created a redirect loop kicking me out of WP. Had to delete my .htaccess to get in.

    Yesterday I deleted all of the TML Pages, deactivated the plugin, and re-activated it to see if that would fix it all but it didn’t re-create the pages for me. So I deactivated the plugin and deleted it entirely (after screenshotting all my settings in case it wiped them, which it did) and re-installed from WP repository. It then re-created the TML pages, but gave it the slug “log-in”.

    page-register.php seems to work properly on the register page, but the ones for page-login.php and page-logout.php aren’t being used. I’ve opened them and made sure that they have the breadcrumb code removed and they do, but your function shows they’re using page.php anyway so I guess it’s irrelevant

    This is at the top:
    <!-- Template Used: /home/....../html/cms/wp-content/themes/THEME_NAME/page.php -->

    Screenshot here… left is source shown in Chrome, right is the theme folder in Coda on Mac showing the files in theme folder on the server.

    I can’t edit or delete my last post, but, for anyone else who comes along, you can re-add proper links in WordPress > Appearance > Menus by going to Screen Options and enabling the Theme My Login page options. I shouldn’t work on anything without eating. ?? Thanks for this great plugin!

    I’m having a similar issue. I already have a page.php, but I’ve duplicated it to create a page-login.php, page-logout.php, and page-register.php and placed them into my theme’s directory, but TML doesn’t seem to use them on those pages.

    I’m using the custom breadcrumb code found here: https://gist.github.com/melissacabral/4032941

    And it’s adding “Theme My Login Page” into the breadcrumb hierarchy (Home > Theme My Login Page > Login) which I don’t want (see this screenshot). So I’m just trying to get rid of the breadcrumbs entirely on the login/out/register pages than fool with it.

    I am not longer getting my Login link created in WordPress > Appearance > Menus to change to Logout when signed in either. Even when signed in, it still says Login. I went into the Menus section and none of the pages are there to add any more either, since you moved the pages into TML > Pages. How do we add a Login link into our menu now that will change to logout upon signing in…?

    dalemoore

    (@dalemoore)

    How do you just remove tabs entirely, without adding them, but keep the product attributes panel itself? It is the only thing I am using, and I have no need for tabs to switch between other things since I am not using reviews or anything else. I want all of that gone, leaving only the image, thumbnails, and product attributes.

    I had this all set up perfectly with actions… but now all of these tabs are showing that I didn’t want. I don’t use the tabs at all, I was outputting what was in the panel elsewhere.

    MAHuijser:

    I’ve never used Wootique, but that theme may be coded to place the ordering in specific locations. By default, WooCommerce only places the pagination and drop-down ordering after the shop loop. So, unless Wootique adds pagination/ordering before all of the products, then
    remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
    does nothing… because it’s already not before the loop to begin with, it’s after. There’s no woocommerce_catalog_ordering there to remove. We are using
    add_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 20 );
    to add the catalog ordering before the loop, as it by default is already after it.

    Treecycle is using

    remove_action('woocommerce_pagination', 'woocommerce_catalog_ordering', 20 );

    to remove the catalog ordering from after the loop, where it is by default. This is my understanding.

Viewing 15 replies - 46 through 60 (of 66 total)