• Resolved Ddaro

    (@darney)


    I am trying to display custom post and categories using my own taxonomy.

    I have a own (taxonomy-page.php).

    When I try add
    echo do_shortcode('[ajax_load_more post_type="projekty"]');
    everything is fine but when I trying add
    echo do_shortcode('[ajax_load_more post_type="projekty" category="projkat1"]');
    I see empty results. Generator showing that structure.

    I also tried

    <?php 
    $cat = get_query_var('cat');
    $category = get_category ($cat);
    echo do_shortcode('[ajax_load_more seo="true" category="'.$category->slug.'"]');
    ?>

    and nothing.
    How to force your plugin to read a specific open category, e.g. taxonomy / projkat1

    • This topic was modified 5 years, 1 month ago by Ddaro.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi @darney
    Are you sure that the category of your custom post type is not actually custom taxonomy?

    If it’s a custom taxonomy, you’ll need to pass in all the required taxonomy parameters.
    https://connekthq.com/plugins/ajax-load-more/docs/code-samples/taxonomy-archives/

    Let me know,

    Thread Starter Ddaro

    (@darney)

    Still nothing.

    I have a register post

     add_action('init', 'projekty_register_post_type'); 
        function projekty_register_post_type() {
        register_post_type('projekty', array(
    
                                             
        'labels' => array(
        'name' => 'Projekty',
        'singular_name' => 'Projekty',
        'add_new' => 'Add projekty',
        'edit_item' => 'Edit projekty',
        'new_item' => 'New projekty',
        'view_item' => 'View projekty',
        'search_items' => 'Search in projekty',
        'not_found' => 'Not found',
        'not_found_in_trash' => 'No info found in Trash'
        ),
        'public' => true,
        'supports' => array(     
        'title',
    	'author',
        'editor',
    	'comments',
        'thumbnail',
        'excerpt',
    	'custom-fields' )
    
       // 'taxonomies' => array('post_tag') // this is IMPORTANT
        ));
    	/* flush_rewrite_rules(); */
        }
    	
    	register_taxonomy("projekty", array("projekty"), array("hierarchical" => false, "label" => "Tags projekty", "singular_label" => "Tags projekty", 'show_admin_column' => true, "rewrite" => true));
    
    add_action( 'init', 'projekty_kategorie', 0 );
    
    function projekty_kategorie() {
    	register_taxonomy( 'projekty_categories', 'projekty', 
    	array( 'hierarchical' => true, 
    	'label' => 'Categories projekty',
    	'show_ui' => true, 
    	'supports'=>'author',
    	
    	'show_admin_column' => true  ) );
    }

    When I use normal WordPress loop with pagination URL example:
    name-site.com/projekty_categories/projcat1
    everything display fine

    only this code is corectly
    echo do_shortcode('[ajax_load_more post_type="projekty"]');

    I dont know why I can’t use shortcode generated from shortcode builder
    category variant display

    this combination should work but not work :/
    echo do_shortcode('[ajax_load_more post_type="projekty" category="projkat1"]');

    Plugin Author Darren Cooney

    (@dcooney)

    @darney This is not working because this is a custom taxonomy, not a standard WP category.

    [ajax_load_more post_type="projekty" taxonomy="projekty_categories" taxonomy_terms="projcat1" taxonomy_operator="IN"]

    Cheers,

    Hi.

    This is great plugin. i am setup it working fine. Initially the browser url also change in infinity scroll. But now the browser URL not change. please help me how to setup. i used all short codes.

    Plugin Author Darren Cooney

    (@dcooney)

    Hi @sekarg You should really start your own thread here… But to change a URL you need an addon. Depending on what type of content this is.

    Okay sorry for that, Its is default post type. I have addon I used this “[ajax_load_more nextpage=”true” nextpage_post_id=”‘.get_the_ID().'” nextpage_scroll=”true:30″ post_type=”post”]” short-code but its not working.

    • This reply was modified 5 years, 1 month ago by Raj.
    Plugin Author Darren Cooney

    (@dcooney)

    Okay i will open there before that please confirm the above short-code is correct?

    Plugin Author Darren Cooney

    (@dcooney)

    I can’t tell sorry. Open the ticket and send me a link to the issue.
    thanks.

    Okay

    Thread Starter Ddaro

    (@darney)

    It’s a pity it doesn’t work. You have taxonomies in the builder so I don’t understand why it doesn’t work. Maybe it’s worth updating the plugin? Your builder sees custom post type and taxonomies, why doesn’t it work?

    I need to have a custom post type to separate the blog from other sections
    There is no method to make it work?

    Plugin Author Darren Cooney

    (@dcooney)

    @darney Are you reading my replies about the taxonomy shortcode?

    Can you open a ticket here and i can have a look for you?
    https://connekthq.com/support/?product=Ajax%20Load%20More

    I’m sure you’re just missing something in the shortcode.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Problem with custom post type category’ is closed to new replies.