Forum Replies Created

Viewing 15 replies - 16 through 30 (of 42 total)
  • Thread Starter jasewarner

    (@jasewarner)

    Okay, it looks like I’ll have to settle with that then.

    Thank you for all your help!

    Thread Starter jasewarner

    (@jasewarner)

    Okay sure, but I’m no longer running flush_rewrite_rules – it’s commented out in the code.

    My permalink structure hasn’t changed, it’s still:

    /work/
    /work/category/faffing/ <– here is the problem: I don’t want “category” in there
    /work/faffing/dirt-devil/

    Is there no way to remove “category” from the taxonomy url?

    Thread Starter jasewarner

    (@jasewarner)

    Okay, thanks for your response.

    The thing is I am running register_taxonomy ahead of register_post_type.
    Here’s the entire block of code from my functions.php file:

    // custom categories
    add_action( 'init', 'create_category' );
    function create_category() {
        register_taxonomy(
            'work-category',
            'work',
            array(
                'label' => __( 'Work Categories' ),
                'hierarchical' => true,
                'show_ui' => true,
                'show_admin_column' => true,
                'rewrite' => array( 'slug' => 'work/category' )
            )
        );
        register_taxonomy(
            'blog-category',
            'blog',
            array(
                'label' => __( 'Blog Categories' ),
                'hierarchical' => true,
                'show_ui' => true,
                'show_admin_column' => true,
                'rewrite' => array( 'slug' => 'blog/category' ),
            )
        );
        //flush_rewrite_rules(); // dev purposes only
    }
    
    // custom post types
    add_action( 'init', 'create_post_type' );
    function create_post_type() {
        // create work post type
        register_post_type( 'work',
            array(
                'labels' => array(
                    'name' => __( 'Work' ),
                    'singular_name' => __( 'Work' ),
                    'add_new' => __('Add New Work')
                ),
                'public' => true,
                'has_archive' => true,
                'menu_position' => 5
            )
        );
        // create blog post type
        register_post_type( 'blog',
            array(
                'labels' => array(
                    'name' => __( 'Blog' ),
                    'singular_name' => __( 'Post' ),
                    'add_new' => __('Add New Blog Post')
                ),
                'public' => true,
                'has_archive' => true,
                'menu_position' => 5
            )
        );
        //flush_rewrite_rules(); // dev purposes only
    }
    Thread Starter jasewarner

    (@jasewarner)

    Ah yes! I forgot to comment out the flush rewrite lines.

    I just did so, resaved options-permalink.php and went back into my Permalink Settings and resaved and I’m no longer getting 404s on my single posts!

    Thanks so much for your patience.

    The only snag now is that my permalinks are set up as follows:

    /work/
    /work/category/faffing/ <– here is the problem: I don’t want “category” in there
    /work/faffing/dirt-devil/

    Is there any way to remove “category” from the taxonomy page urls?

    Thanks so much again – at least the single posts are working now.

    Thread Starter jasewarner

    (@jasewarner)

    Sure, thanks.

    The value of “Matches Rewrite Rule” on a single post page is:

    work/[^/]+/([^/]+)/?$

    The “Matches Rewrite Query” value is:

    attachment=something

    Thread Starter jasewarner

    (@jasewarner)

    Oh right, I’ll exercise a little patience in the future then.
    It’s frustrating that the reply doesn’t show up right away though.

    Thanks for your help on this.

    Thread Starter jasewarner

    (@jasewarner)

    Okay, I’ve saved wp-admin/options-permalink.php, so the rewrite rules have been flushed.
    But I’m sorry, I don’t quite understand what you meant by:

    After Regenerate rewrite rules,
    if /work/category/acting/ 404, register_taxonomy before _register_post_type.

    Can you elaborate please?
    Thanks again for your patience and help.

    Thread Starter jasewarner

    (@jasewarner)

    Common Settings is set to Post Name.

    But I was under the impression that the default settings are disregarded as soon as custom settings are put in place?

    Thread Starter jasewarner

    (@jasewarner)

    Thanks for the quick reply.

    My apologies if I’m missing something obvious, but by changing my slug to what you have suggested, I end up with following structure:

    /work/ <–post type
    /work/category/acting/ <–category
    /work/acting/something/ <–single post 404

    This isn’t working for me at all, so I’m guessing I have misunderstood you?

    Thread Starter jasewarner

    (@jasewarner)

    Thanks for your response!

    I think I understand what you are saying… the same word cannot be used in both the post type and taxonomy, right?

    If so, I tried creating a new taxonomy that doesn’t use the word “work” but I still get a 404 on single posts. Here’s my new taxonomy in functions.php:

    register_taxonomy(
            'category-one',
            'work', // apply to 'work' post type
            array(
                'label' => __( 'Work Categories (1)' ),
                'rewrite' => array( 'slug' => 'work' ),
                'hierarchical' => true,
                'show_ui' => true,
                'show_admin_column' => true
            )
        );

    And my custom permalink now looks like: /work/%category-one%/%postname%/

    Do you know why it still wouldn’t be working?

    Thanks for your help.

    Thread Starter jasewarner

    (@jasewarner)

    I’m still working on this (albeit at an intermittent pace) and I’ve just discovered that changing the common permalink settings to default (e.g. https://www.site.com/?p=123) gets everything working.

    So, it seems to be a problem with the postname being called.
    I’ve checked and I don’t have any categories or pages named the same as the two post types I created.

    Anybody have any ideas at all?

    Thread Starter jasewarner

    (@jasewarner)

    *** RESOLVED ***

    If anybody ever happens to run into this problem, here’s the solution…
    I entered the following code in the Callback settings field of the plugin:

    (function($) {
    var $container = $('#masonry-container'); // this is the content selector
    $container.imagesLoaded( function() {
        $container.masonry({
            itemSelector: '.box' // this is the item selector
        });
    });
    })(jQuery);
    Thread Starter jasewarner

    (@jasewarner)

    I’m afraid that the variations are already taken up by the typeface, e.g. Bold, Italic, Regular etc.

    Any more ideas?!

    Thread Starter jasewarner

    (@jasewarner)

    Any ideas on this one?

    Thread Starter jasewarner

    (@jasewarner)

    *** UPDATE ***

    I have managed to fix the overlapping issue by changing the callback from this:

    var $newElems = $( newElements ).css({ opacity: 0 });
        $newElems.imagesLoaded(function(){
        $newElems.animate({ opacity: 1 });
        $('#masonry-container').masonry( 'appended', $newElems, true );
      });

    to this:

    (function($) {
        var $newElems = $( newElements ).css({ opacity: 0 });
        $newElems.imagesLoaded(function(){
            $newElems.animate({ opacity: 1 });
            $('#masonry-container').masonry( 'appended', $newElems, true );
        });
    })(jQuery);

    However, whilst the overlapping issue is fixed there is now a problem with spacing each time infinite scroll is called upon. Here’s a link as an example: https://79.170.44.118/pr-2015.com/galerie/2010/

    Any ideas?

Viewing 15 replies - 16 through 30 (of 42 total)