Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #890174

    Drakah
    Participant

    I am using WP Download Manager (http://www.wpdownloadmanager.com/) and I cannot get the Categories to show up from creating them within the plugin. I emailed WPDM about it and the response I got back was:

    WPDM categories are actually custom taxonomy, and the breadcrumb is controlling by your theme, in your theme, there should pick custom taxonomy instead of regular category, however, if you can use the breadcrumb with Yoast SEO plugin, it will work fine, otherwise you need to contact theme developer to adjust the breadcrumb.

    So, what do I do?

    URL: http://shakahr.com/files/default-old/
    WordPress version: 4.5
    X version: 4.4.2
    Cornerstone plugin version: 1.2.4

    #890939

    Lely
    Moderator

    Hi There,

    Would you mind providing us with login credentials so we can take a closer look? Your site seems to be on Under Construction Mode. To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #891001

    Drakah
    Participant
    This reply has been marked as private.
    #891634

    Paul R
    Moderator

    Hi,

    Regretfully this isn’t a feature offered by X. It could be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities. Thanks for understanding. Take care!

    #892017

    Drakah
    Participant

    That is very unfortunate because now the only option I have is to use Yoast SEO to handle the breadcrumb portion.

    http://kb.yoast.com/article/245-implement-wordpress-seo-breadcrumbs

    I am not sure where to place the code since I am using the Integrity theme, can you give me direction the correct place to put the code please?

    To implement the breadcrumbs function in Yoast SEO, you will have to edit your theme. Copy the following code into your theme where you want the breadcrumbs to be:

    <?php if ( function_exists(‘yoast_breadcrumb’) )
    {yoast_breadcrumb(‘<p id=”breadcrumbs”>’,'</p>’);} ?>

    Common places where you could place your breadcrumbs are inside your single.php and/or page.php file just above the page’s title. Another option that makes it really easy in some themes is by just pasting the code in header.php at the very end.
    In most themes, this code snippet should not be added to your functions.php file. If you have trouble locating the correct place to add the code, please contact the theme developer for assistance.

    #892059

    Drakah
    Participant

    It looks like I have to edit the wp-header.php within the wp-content/themes/x/framework/views/integrity folder. Is that right?

    #892104

    Drakah
    Participant

    I think it is worse now… every page I have now shows this new Yoast Navigation at the top and I don’t want that at all.
    I just want the WPDM category to show like it is supposed to in the download files pages.

    If your theme isn’t going to make this work, what do you suggest me to do?

    #892169

    Drakah
    Participant

    Yoast is now aggravating me and had to deactivate it.
    Although it does technically allow usage of custom taxonomies by using its

      own

    method of a navigation (by adding one….), it is not going to fix my initial issue of enabling the categories for WPDM. Even if I was to somehow use Yoast, I will still have a missing section between the Date and Comment underneath the Download filename.

    Really don’t know what to do here.
    Is there a simple plugin that would allow these custom taxonomies to appear correctly?

    Thanks

    #892967

    Rue Nel
    Moderator

    Hello There,

    X always displays the categories in normal post. However, WPDM categories are actually custom taxonomy. This is why your WPDM categories is not showing and this is a custom post type. To be able to display it, what you are trying to accomplish requires a template customization, we would like to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Once you already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.

    // Custom Integrity Meta to support WPDM categories
    // =============================================================================
    function x_integrity_entry_meta() {
    
      //
      // Author.
      //
    
      $author = sprintf( '<span><i class="x-icon-pencil" data-x-icon=""></i> %s</span>',
        get_the_author()
      );
    
      //
      // Date.
      //
    
      $date = sprintf( '<span><time class="entry-date" datetime="%1$s"><i class="x-icon-calendar" data-x-icon=""></i> %2$s</time></span>',
        esc_attr( get_the_date( 'c' ) ),
        esc_html( get_the_date() )
      );
    
      //
      // Categories.
      //
    
      if ( get_post_type() == 'x-portfolio' ) {
        if ( has_term( '', 'portfolio-category', NULL ) ) {
          $categories        = get_the_terms( get_the_ID(), 'portfolio-category' );
          $separator         = ', ';
          $categories_output = '';
          foreach ( $categories as $category ) {
            $categories_output .= '<a href="'
                                . get_term_link( $category->slug, 'portfolio-category' )
                                . '" title="'
                                . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                                . '"><i class="x-icon-bookmark" data-x-icon=""></i> '
                                . $category->name
                                . '</a>'
                                . $separator;
          }
    
          $categories_list = sprintf( '<span>%s</span>',
            trim( $categories_output, $separator )
          );
        } else {
          $categories_list = '';
        }
      } else {
    
        if ( get_post_type() == 'wpdmpro') {
          $categories        = get_the_terms( $id, 'wpdmcategory' );
        } else {
          $categories        = get_the_category();
        }
    
        $separator         = ', ';
        $categories_output = '';
        foreach ( $categories as $category ) {
          $categories_output .= '<a href="'
                              . get_category_link( $category->term_id )
                              . '" title="'
                              . esc_attr( sprintf( __( "View all posts in: &ldquo;%s&rdquo;", '__x__' ), $category->name ) )
                              . '"><i class="x-icon-bookmark" data-x-icon=""></i> '
                              . $category->name
                              . '</a>'
                              . $separator;
        }
    
        $categories_list = sprintf( '<span>%s</span>',
          trim( $categories_output, $separator )
        );
      }
    
      //
      // Comments link.
      //
    
      if ( comments_open() ) {
    
        $title  = apply_filters( 'x_entry_meta_comments_title', get_the_title() );
        $link   = apply_filters( 'x_entry_meta_comments_link', get_comments_link() );
        $number = apply_filters( 'x_entry_meta_comments_number', get_comments_number() );
    
        if ( $number == 0 ) {
          $text = __( 'Leave a Comment' , '__x__' );
        } else if ( $number == 1 ) {
          $text = $number . ' ' . __( 'Comment' , '__x__' );
        } else {
          $text = $number . ' ' . __( 'Comments' , '__x__' );
        }
    
        $comments = sprintf( '<span><a href="%1$s" title="%2$s" class="meta-comments"><i class="x-icon-comments" data-x-icon=""></i> %3$s</a></span>',
          esc_url( $link ),
          esc_attr( sprintf( __( 'Leave a comment on: &ldquo;%s&rdquo;', '__x__' ), $title ) ),
          $text
        );
    
      } else {
    
        $comments = '';
    
      }
    
      //
      // Output.
      //
    
      if ( x_does_not_need_entry_meta() ) {
        return;
      } else {
        printf( '<p class="p-meta">%1$s%2$s%3$s%4$s</p>',
          $author,
          $date,
          $categories_list,
          $comments
        );
      }
    
    }
    // =============================================================================

    If you can use the breadcrumb with Yoast SEO plugin, please follow the following steps below:
    1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
    2] Insert the following code into that new file

    <?php
    
    // =============================================================================
    // VIEWS/INTEGRITY/_BREADCRUMBS.PHP
    // -----------------------------------------------------------------------------
    // Breadcrumb output for Integrity.
    // =============================================================================
    
    ?>
    
    <?php if ( ! is_front_page() ) : ?>
      <?php if ( x_get_option( 'x_breadcrumb_display' ) == '1' ) : ?>
    
        <div class="x-breadcrumb-wrap">
          <div class="x-container max width">
    
            <?php //x_breadcrumbs(); ?>
    
            <?php if ( function_exists('yoast_breadcrumb') ) {
                    yoast_breadcrumb('<p id="breadcrumbs">','</p>');
            } ?>
    
            <?php if ( is_single() || x_is_portfolio_item() ) : ?>
              <?php x_entry_navigation(); ?>
            <?php endif; ?>
    
          </div>
        </div>
    
      <?php endif; ?>
    <?php endif; ?>

    3] Save the file named as _breadcrumbs.php
    4] Upload this file to your server in the child theme’s folder
    wp-content/themes/x-child/framework/views/integrity/

    As this is all custom development, regretfully we won’t be able to assist further. Custom development is outside the scope of our support. We’re happy to provide advice and get you started in the right direction, but you would still be responsible for the implementation.

    Thank you for your understanding.

    #893182

    Drakah
    Participant

    WOW, that is Amazing you figured this out!! I used the 1st option you gave and did not need to use Yoast thankfully. The patch for the functions.php file worked flawlessly once I realized I had to save the PHP file as a UTF-8 because of the icons. Thanks for helping me! I cannot thank you enough, you really made my night! 🙂

    As for the child theme…. that has me confused. I had edited the Parent CSS via customizer, and probably some other things. I installed the child theme like you said and activated it, and I see no difference in anything, so my settings must have carried over? or are they stuck in the parent theme? Do I need to somehow revert the parent theme settings someplace? Just to be safe I manually re-uploaded the theme files for the X folder. I did look at the x-child folder and the framework folder and its contents has no files, just a bunch of empty folders, is that right?

    Again, thank you so much for helping me!

    #893825

    Jack
    Keymaster

    Hi there,

    Thanks for writing back! Fantastic! Glad to hear that worked for you. 🙂

    The child theme is where any code changes should be, like the breadcrumb modification, this ensures that the code isn’t lost on a update, as on updates, all files are overwritten of any parent theme, which is the WordPress way.

    Whereas a child theme ensures your modifications aren’t lost. Custom CSS and JS, can be used either within the customizer or within a custom style sheet and scripts within your child theme, either option is fine. 🙂

    Thanks!

    #894010

    Drakah
    Participant

    I Spoke too soon.
    With the code in the functions.php I am getting this error

    —removed for privacy—/wp-includes/pluggable.php on line 1171

    when I save options on things or try to access my media library.

    I reverted back to the original functions.php for now until I hear back

    #894886

    Rue Nel
    Moderator

    Hello There,

    To avoid the error, you should only add the custom code in your child theme’s functions.php file.

    To make sure that you have the same settings when switching over with the child theme, please make sure that you have backup your customizer settings. You can access this in X Addons > Customizer Manager section (https://community.theme.co/kb/customizer-manager/). You need to download the XCS file to your local computer. After you switched to the child theme, you can import the XCS file again to make sure that you have the same settings when you are using the parent theme.

    Hope this helps.

    #895415

    Drakah
    Participant

    I only did add the custom code to the child theme.
    That is when the error started.
    I realized it was this code because once I switched back the parent theme, the error was gone, and came back once I added the code to the parent theme, which I removed.

    #895524

    Drakah
    Participant

    I think I figured out why….
    I saved the functions.php file directly and uploaded it via FTP, I think it didnt like however I saved it again.

    I reverted back to the original functions.php file, and edited it via Dashboard–>Appearance–>Editor
    and it saved fine there without any errors so far, so I think I am OK now.

    I did go back to the main theme and saved the XCS file, Reset, and enabled the child theme, imported XCS file, just to be safe that I have a “clean” version.