*

BayChaser

  • **
  • 13 posts
Listing Custom fields Color issue
« on: August 15, 2025, 07:55:20 PM »
Hi, im not sure if this is part of the theme or something else. Im using starter theme customized and only  pligins and I did everything but im getting #02737 when I select color. Oes anyone know what can cause this.

Everything works fine it's just when I select color and publish post i get #82622 inst3d of the color
« Last Edit: August 16, 2025, 12:48:53 AM by BayChaser »

*

BayChaser

  • **
  • 13 posts
Re: Listing Custom fields Color issue
« Reply #1 on: August 16, 2025, 05:47:10 PM »
Is there anyone that can point me to location on where to look or idea how to fix it.

*

MB Themes

Re: Listing Custom fields Color issue
« Reply #2 on: August 16, 2025, 06:44:41 PM »
Can you share url to test?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

BayChaser

  • **
  • 13 posts
Re: Listing Custom fields Color issue
« Reply #3 on: August 16, 2025, 07:44:12 PM »
Its on my local host server im trying out all the features and checking for bugs before I decide to use the script. But yes the color custom feild doesn't work and just displays #32334 but not the actual color so it's not the theme it's the script it's self. They it on your demo and you will see that it doesn't work. I have no plugins and basic theme is used. I think this is a great feature to have and seing good plugins and themes and I do see potential in this script.
« Last Edit: August 16, 2025, 07:53:57 PM by BayChaser »

*

BayChaser

  • **
  • 13 posts
Re: Listing Custom fields Color issue
« Reply #4 on: August 16, 2025, 10:31:39 PM »
Can you share url to test?

Did you managed to produce the same im eager to know .
But so far I can see that this script is amazing and will be going live soon. I see absolutely no other problems but minor things that can be easy changed and fixed
 Im just having a hard time locating this small issue.
« Last Edit: August 16, 2025, 10:34:25 PM by BayChaser »

*

BayChaser

  • **
  • 13 posts
Re: Listing Custom fields Color issue
« Reply #5 on: August 17, 2025, 05:17:29 AM »
Even trying with this code still displaying the same but no color

Code: [Select]
<?php
// Custom function to display item color meta
function my_custom_item_color_display() {
    
// Check if the meta value 'item_color' exists and is not empty
    
if (osc_item_meta_value('item_color')) {
        
$item_color = osc_item_meta_value('item_color');
        echo 
'<div class="item-color-info" style="background-color: ' . esc_attr($item_color) . ';">';
        echo 
'Item Color: ' . esc_html($item_color);
        echo 
'</div>';
    }
}

// Attach the function to the 'item_description' hook (assuming it's available in your theme's item.php)
osc_add_hook('item_description', 'my_custom_item_color_display');
?>

*

MB Themes

Re: Listing Custom fields Color issue
« Reply #6 on: August 18, 2025, 10:53:36 AM »
I've just tested on Osclass 8.3 custom field of color type and could not reproduce any issue with it.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

BayChaser

  • **
  • 13 posts
Re: Listing Custom fields Color issue
« Reply #7 on: August 18, 2025, 01:22:52 PM »
Ohhh ok im glad you tested it so it does work it's on my end. OK thank you. What PHP Version would you recommend using with the script and you think my PHP version could be a problem? Im using 8.2 version

Because it has to be the PHP version problem since im testing on stock Theme and fresh install of Osclass 8.3
« Last Edit: August 18, 2025, 01:44:39 PM by BayChaser »

*

MB Themes

Re: Listing Custom fields Color issue
« Reply #8 on: August 18, 2025, 07:38:20 PM »
Dont think so. Try different browser (just curious).
Php 8.4 should be OK.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

BayChaser

  • **
  • 13 posts
Re: Listing Custom fields Color issue
« Reply #9 on: August 18, 2025, 08:27:11 PM »
Ok will do and thank you. I was using Chrome and mobile device. I will keep checking. Thank you again

*

BayChaser

  • **
  • 13 posts
Re: Listing Custom fields Color issue
« Reply #10 on: August 19, 2025, 06:46:30 PM »
Dont think so. Try different browser (just curious).
Php 8.4 should be OK.

Can you tell me which files contain and are responsible for handling Custo Color Atributes..
I will see if I can dig something up haha.

*

BayChaser

  • **
  • 13 posts
Re: Listing Custom fields Color issue
« Reply #11 on: August 20, 2025, 12:26:52 AM »
In case someone else runs into this problem.

Edit your item.php and use this code insted

Code: [Select]
<div class="field name<?php echo osc_item_meta_name(); ?> value<?php echo osc_esc_html(osc_item_meta_value()); ?>">
  <span class="name"><?php echo osc_item_meta_name(); ?><?php if(substr(trim(osc_item_meta_name()), -1) != ':') { echo ':'; } ?></span>
  <span class="value color-swatch" style="background-color: <?php echo osc_esc_html(osc_item_meta_value()); ?>;"><?php echo osc_item_meta_value(); ?></span>
</div>

add CSS and done.

Code: [Select]
.color-swatch {
  display: inline-block; /* Essential for applying width/height */
  width: 40px; /* Adjust as needed */
  height: 40px; /* Adjust as needed */
  /* For a square */
  /* border-radius: 0; */
  /* For a circle */
  border-radius: 50%; /* */
  border: 1px solid #ccc; /* Add a subtle border for better visibility */
  vertical-align: middle; /* Align the color swatch vertically with the text */
  margin-right: 5px; /* Add some space between the text and the swatch */
  text-indent: -9999px; /* Hide the actual text value but keep it accessible for screen readers */
  overflow: hidden; /* Hide the overflowing text if text-indent is not used */
}
« Last Edit: August 20, 2025, 12:28:41 AM by BayChaser »

*

MB Themes

Re: Listing Custom fields Color issue
« Reply #12 on: August 20, 2025, 01:09:21 PM »
Thanks for feedback ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

BayChaser

  • **
  • 13 posts
Re: Listing Custom fields Color issue
« Reply #13 on: August 20, 2025, 06:02:46 PM »
Thank you guys for offering awesome script out of the box, it's truly amazing 👏