EvieB

How to adjust category display

Hi there, I'm using the coupon child theme and wondered how I go about including a vertical bar glyph between the icon and category name as shown in the original image below for the child theme please? Any help would be appreciated.

Created: July 22, 2020 at 1:30 am
  • In: General Discussion
  • Started by: EvieBEvieB
  • 4 members left 16 comments
  • Last reply from: JamesDJamesD

  • Marie
    Marie
    July 30, 2020 at 10:07 am

    hi Elvie,

    can you attach a screenshot please?

  • Faisal
    Faisal
    September 6, 2020 at 1:12 am

    1-Sub categories not showing on category page
    2- no category block in elementor
    3. still u didnt make required/not required option in cutom fileds

  • EvieB
    EvieB
    September 7, 2020 at 12:08 am

    Attached is a screenshot, thanks.

    Attachments:
    You must be logged in to view attached files.
  • JamesD
    JamesD
    September 7, 2020 at 11:14 pm

    Hello EvieB,

    Try adding this CSS and see if the display is what you’re looking for:
    . i::after {
    content: "|";
    margin: 0 10px;
    color: initial;
    }

  • EvieB
    EvieB
    September 8, 2020 at 12:50 am

    Hi James, You’re always such good help! That worked wonders. Now just trying to get it to display the | directly underneath each other like the original… They’re all in line until the fa icons display, then they move all over the place like the screenshot below. Would I need to do something with the css for ::before perhaps? Sorry, I know I’m being OCD about this!

    Attachments:
    You must be logged in to view attached files.
  • JamesD
    JamesD
    September 9, 2020 at 1:17 am

    Hello Evie,

    Been trying to find the best method for you without needing to alter any files and I think the “quickest & easiest” way would be to use one line of javascript.

    So, replace the other CSS to use:
    .sf-vertical i::after {
    content: "|";
    margin: 0 5px 0 10px;
    color: initial;
    }

    Then add this to the JS settings under PremiumPress > Design Setup > CSS & JS > Custom JS Code.

    Note: You can add this to a custom JS file instead (if you currently use one).
    jQuery('.cat-item a i').addClass('fa-fw');

  • EvieB
    EvieB
    September 9, 2020 at 2:19 am

    Hi Jamie

    I really appreciate you coming up with a solution for me! 🙂 Here’s how it looks now.

    Attachments:
    You must be logged in to view attached files.
  • JamesD
    JamesD
    September 9, 2020 at 4:50 am

    @EvieB
    Hmmmm, there’s no difference… Ok, go ahead and remove the previous CSS & JS mentioned.

    Download and extract the attached file. If the file already exists in your child theme directory then copy the contents of the included file and add it to the bottom of your existing file.

    Otherwise, just upload the file directly into your child theme directory.

    Attachments:
    You must be logged in to view attached files.
  • JamesD
    JamesD
    September 9, 2020 at 4:58 am

    A brief explanation of what it does…
    It will add the corrective javascript in the footer to all non admin pages.

  • EvieB
    EvieB
    September 10, 2020 at 12:52 am

    Beautiful James! That worked a treat. You’re a legend. Thanks for all your efforts. 🙂

  • JamesD
    JamesD
    September 11, 2020 at 2:33 am

    You’re welcome Evie.

  • EvieB
    EvieB
    September 13, 2020 at 1:19 am

    Hi again James,

    Apparently you can’t start new topics in the forum at the moment, so I wondered if you would know where I can fix the following please? On my add listing page for the coupon child theme I have some custom fields, ie. coupon code, affiliate link, store, that don’t show up in the / file. I want to add a placeholder in the fields but can’t find where I can edit them. Do you know where I can access them thanks?

    I might have already asked you this question before, but do you know if it’s possible to add a new store from the front end? I’m thinking that it will stop local businesses from adding their business if they can’t add their business from the front end and have to ask admin to add it in in advance so they can submit a listing!!! lol

  • JamesD
    JamesD
    September 14, 2020 at 3:53 am

    Hello Evie,

    “On my add listing page for the coupon child theme I have some custom fields, ie. coupon code, affiliate link, store, that don’t show up in the / file. I want to add a placeholder in the fields but can’t find where I can edit them. Do you know where I can access them thanks?”

    I’m not sure I fully understand. What type of placeholders are you talking about adding default text to the input boxes?

    The file that you’re looking for would be the /CP9/framework/new_.

    If you want to to add default text for the coupon code and affiliate link input, then begin looking around line #806 and you should see this portion of code:
    // GET THE FIELD VALUE
    $FIELDVALUE = "";
    if(isset($field['name']) && $field['name'] == "post_tags" && isset($_GET['eid']) ){
    $FIELDVALUE = "";
    $tfs = wp_get_post_tags($_GET['eid']);
    if(!empty($tfs)){
    foreach($tfs as $ta){ $FIELDVALUE .= $ta->name.", "; }
    }
    }elseif(isset($field['name']) && isset($_GET['eid'])){
    $FIELDVALUE = get_post_meta($_GET['eid'],$field['name'],true);
    }

    if(!isset($field['required'])){ $field['required'] = false; }
    Replace the above lines with these:
    // GET THE FIELD VALUE
    $FIELDVALUE = "";
    if(isset($field['name']) && $field['name'] == "post_tags" && isset($_GET['eid']) ){
    $FIELDVALUE = "";
    $tfs = wp_get_post_tags($_GET['eid']);
    if(!empty($tfs)){
    foreach($tfs as $ta){ $FIELDVALUE .= $ta->name.", "; }
    }
    }elseif(isset($field['name']) && isset($_GET['eid'])){
    $FIELDVALUE = get_post_meta($_GET['eid'],$field['name'],true);
    }elseif( $field['name'] !== 'type') {
    switch($field['name']){
    case 'code':
    // Set default coupon placeholder text
    $FIELDVALUE = 'CouponPlaceholder';
    break;
    case 'link':
    // Set default affiliate link placeholder text
    $FIELDVALUE = 'AffiliateLinkPlaceholder';
    break;
    }
    }

    if(!isset($field['required'])){ $field['required'] = false; }
    Note: Be sure to change the CouponPlaceholder & AffiliateLinkPlaceholder to the default text you want.

    The store field would be handled differently and, honestly, this could easily end up being more complicated than what it’s worth. Don’t forget to make a backup of the file first.

    “I might have already asked you this question before, but do you know if it’s possible to add a new store from the front end?”

    If you’re referring to non-admin users, no, not that I’m aware of. Only admin can add stores.

  • EvieB
    EvieB
    September 14, 2020 at 4:16 am

    Thanks for your help James. Yes I wanted to include default text to the input boxes that is overwritten when filled out by the user. I’ve done what you suggested, but it isn’t showing up in the fields. I saved it to my child theme, or is it one of those files I need to upload to the CP9 theme folder?


Viewing 15 posts - 1 through 15 (of 17 total)