I have purchased a theme from themeforest and they have a custom post type to create a masonry view of images.
1) When I add the custom post type (included in the premium theme) the images in the masonry view are linked to their pages using href I believe (When a user clicks on the image it directs them to the page where the image was pulled from). I would like to remove the link and make the view just capable of viewing the images without the images being clickable.
2) The images also show two boxes of infos, the category the image is from and some sort of detail. I would also like to remove the detail and just keep the category info text.
I would like a CSS I can use on the page to achieve this. Thank You...
I have purchased a theme from themeforest and they have a custom post type to create a masonry view of images.
1) When I add the custom post type (included in the premium theme) the images in the masonry view are linked to their pages using href I believe (When a user clicks on the image it directs them to the page where the image was pulled from). I would like to remove the link and make the view just capable of viewing the images without the images being clickable.
2) The images also show two boxes of infos, the category the image is from and some sort of detail. I would also like to remove the detail and just keep the category info text.
I would like a CSS I can use on the page to achieve this. Thank You...
Share Improve this question asked May 13, 2020 at 19:29 AAloAAlo 32 bronze badges1 Answer
Reset to default 0The best way to achieve your goals would be to create a child theme, and copy whichever PHP file is responsible for the page you're wanting to edit into the child theme. You can then remove the links and additional information so that it's actually gone from the page. That way, no one will accidentally see the information you're trying to remove. (Screen readers, for example, wouldn't know that removing link styling means you don't want anyone to be able to use a link. And anyone on a slow connection might see some of the text you're trying to hide before CSS loads.)
CSS can be used to hide things, but it can't disable links. If you want to stick with the CSS route, you might try asking on StackOverflow where CSS questions are on topic, and make sure to provide the HTML so people can help with the CSS. Another way you could potentially disable the links would be to use JavaScript, but again that would be more of a StackOverflow question as it's not WordPress-specific. You would want to add that either in a child theme or a plugin, but it's typically best to remove things directly from PHP so that they're never output, rather than making a user load all the resources, add the info to the page, then have a JavaScript remove things from the page, which makes the load time slower and the overall code more complex.