Tagged: specific page edits
- This topic has 8 replies, 3 voices, and was last updated 9 years, 11 months ago by
Sebastian.
Author | Posts |
---|---|
robertlo
May 13, 2015 at 6:34 pm
|
Heads up! this post was created when Microthemer was at version 3. The current version is 7. Some references to the interface may be out of date. Is there a way to go directly to a URL on a page to edit certain elements of it that may only exist on that page? |
Sebastian
May 15, 2015 at 1:50 am
|
Hi Robert, Yes, you can enter a custom URL via the preferences in the left toolbar and Microthemer will then go to that page. A few people miss this option it seems. I’m currently pondering whether their should be an option for entering a custom url more easily that would reload the preview page immediately. Just not sure where this would go at moment… Does that answer your question though? At first I thought you might be asking if it’s possible to create styles that apply to just one page, even if the element appears on different pages. It is, but requires prepending the selector code with page ids e.g.
This requires that your theme inserts page ids in the body class attribute (many do). Cheers, ps the selector wizard will have some variation options in a future release that will make individual page targeting (and targeting in general) much easier. |
robertlo
May 16, 2015 at 4:56 pm
|
Sebastian, Sounds good. And yes I was just asking how to go to a specific page in MT. For page specific css, I’ve always use a the Add to Head plugin, as it lets you add any code to the head of any page or post (and most any post type). But if I can do that in MT, I’d rather do it there to keep all custom css in one place. |
Sebastian
May 17, 2015 at 1:29 am
|
Great, you’ll like the new selector wizard when we roll that out then. It will have variation options for automatically prepending selectors with page IDs etc, or appending pseudo selectors like :hover, :nth-of-type etc. |
robertlo
May 23, 2015 at 6:12 pm
|
Hmm. I used .page-id-9 .my-selector to prepend the MT CSS, which made it .page-id-9 .my-selector main#main img.wp-post-image Behavior set to none, but that brought the images back, instead of hiding them as they were with only main#main img.wp-post-image , which I don’t want to use because they hides the product image from all pages, even the individual product pages. I only want to hide it from shop pages. The theme is WooCommerce’s general StoreFront theme, so since prepending the selector code with .page-id-9 .my-selector actually caused the product images to display again, does that mean the theme doesn’t inserts page ids in the body class attribute? However, I did find the code to do hide product images in the shop page in functions.php remove_action( ‘woocommerce_before_shop_loop_item_title’, ‘woocommerce_template_loop_product_thumbnail’, 10 ); However, this is a multisite, and it looks like the changes I apply to functions.php are applying network-wide, which I think is something I’m doing wrong on my end. I’d rather hide the product images on shop pages with with php instead of CSS…..if I can. But I need that edit to be applied per site in my multisite network, not to all sites in the network. But until I figure that out, if you can help me do that with MT, that would be great. If not, I can just put the css in that page using the Per Page Head plugin, but I like to keep my plugins to a minimum. Any thoughts? |
Sebastian
May 24, 2015 at 7:13 am
|
Hi Robert, I must apologise. I wasn’t clear enough that .page-id-45 .my-selector was just an example and not actually a valid CSS selector. I would need to have a look at your site (specifically the page you’re referring to), but then I should be able to provide you with a real selector that hides the images. Could you post a link to your site here or send it via our contact form? https://themeover.com/support/contact/ Cheers, |
robertlo
May 25, 2015 at 4:56 am
|
I also tried .page-id-9 main#main img.wp-post-image as the page ID is 9 for this page, but that didn’t work either. Here’s the page I want to hide product images for. It’s the main WooCommerce shop page. |
Abland
May 27, 2015 at 5:37 am
|
Hi, robertlo, Maybe try this in your theme’s functions.php
I use blog ids one at a time because I couldn’t get an array to work – so for multiple blogs to remove thumbnails use: |
Sebastian
May 27, 2015 at 9:03 am
|
Thanks for catching this Abland. And sorry for the delay in responding Robert. Unfortunately your theme doesn’t seem to insert page-ids in the body class. So I would recommend Abland’s solution as you wanted to switch off the images more than hide them with CSS anyway. Have you had much luck with the code Abland provided? Cheers, ps If you only want the images to be removed on one page (with page id 9) you might try this instead:
|