Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #392028

    Hi,

    At the moemnt I’m using this code in my child functions.php

    `// post
    if (!class_exists(‘avia_customcptbox_post’)) {
    class avia_customcptbox_post extends avia_newsbox {
    function avia_customcptbox_post() {
    $this->avia_term = ‘nieuws_cat’;
    $this->avia_post_type = ‘nieuws’;
    $this->avia_new_query = ”; //set a custom query here
    $widget_ops = array(‘classname’ => ‘newsbox’, ‘description’ => ‘A Sidebar widget to display latest post entries in your sidebar’ );

    $this->WP_Widget( ‘customcptbox_post’, THEMENAME.’ Latest CPT Nieuws’, $widget_ops );
    }
    }
    register_widget( ‘avia_customcptbox_post’ );
    }

    When I replace the custom taxonomy “nieuws_cat” with the standard category taxonomy the widget stops functioning.
    Any idea how to fix this?

    I don’t mind to use the custom taxonomy but then I would like to be able to hide this taxonomy category in the meta info beneath the post title.

    Best regards,
    Arjan

    #392661

    Hey Arjan de Wit!

    Thank you for using Enfold.

    Please provide a link to the actual page with widget. The category beneath the post title should not be included by default.

    Cheers!
    Ismael

    #392932
    This reply has been marked as private.
    #393562
    This reply has been marked as private.
    #394957

    Hey!

    Alright. Use this to hide the category:

    span.blog-categories.minor-meta, .text-sep-cat {
    display: none;
    }

    Best regards,
    Ismael

    #394984

    Hey,

    I don’t want to hide the category completely. I want to hide “test” from showing up, but I still want to show “Publicatie” as a category.

    Best regards,
    Arjan

    #395098

    Hi!

    Remove the code above then use this on the functions.php file:

    add_action('wp_footer', 'ava_remove_test', 10);
    function ava_remove_test(){
    ?>
    <script>
    (function($){
    	$(window).load(function() {
    		$( "span.blog-categories.minor-meta a:contains('test')" ).css( "display", "none" );
    	});
    })(jQuery);
    </script>
    <?php
    }

    Regards,
    Ismael

    #395107

    Seems like this solutions only works for “test”, but what if the testtax taxonomy contains multiple categories?

    It need to filter out a complete taxonomy not a category from this taxonomy (in this case test)

    #395118

    Let’s get back to the real problem:

    This works:
    $this->avia_term = ‘nieuws_cat’;
    $this->avia_post_type = ‘nieuws’;

    This doesn’t work
    $this->avia_term = ‘category’;
    $this->avia_post_type = ‘nieuws’;

    I need the CPT widget to work with the category taxonomy and the cpt nieuws.

    #395580

    But that widget doesn’t support custom post types…

    #395689

    Hi!

    How many custom post types do you have? Try the solution provided here to create widgets for different custom post types:

    https://kriesi.at/support/topic/multiple-versions-of-latest-cpt-widget/#post-369273

    Regards,
    Ismael

    #395735

    The solution mentioned in that topic (the topic I started!) is the solution I’m using right now.But I have to use a different taxonomy or else it won’t work. Which bring me back to the original question: is it possible to use a modified version of the Enfold latest News widget that supports custom post types AND the normal category taxonomy.

    #395881

    Ok I found a solution.So this topic can be closed.

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Custom CPT widget’ is closed to new replies.