• Resolved hirngesicht

    (@hirngesicht)


    Hello! I just noticed that archives that use a content template don’t seem to measure views properly. I’ve noticed in the past that get_the_id() inside such a template isn’t working quite like it should, so maybe this is unsolveable. Still making a report in case you’re a wizard or something. If not, I’ll just convert it to a page instead, no worries.

    Here’s the network request in the browser console log. Note how “source_id” is empty:

    wp_statistics_hit: 1
    source_type: archive
    source_id: 0
    search_query:
    signature: fbad2f2b908b9dc26ec8689cc3fca8d6
    action: wp_statistics_hit_record
    referred: aHR0cHM6Ly93d3cud2luZXRhYmxlLnNlLw==
    page_uri: L3JlY2VwdC8=

    The page is generated from this file:
    site/web/app/themes/example/resources/views/partials/content/content-recept.blade.php

    How it’s registered in setup.php:

    register_post_type(

    'recept',

    [

    'labels' => [

    'name' => _x('Recept', 'post type general name'),

    'singular_name' => _x('Recept', 'post type singular name'),

    'add_new' => _x('Lägg till Recept', 'book'),

    'add_new_item' => __('Lägg till nytt Recept'),

    'edit_item' => __('Redigera Recept'),

    'new_item' => __('Nytt Recept'),

    'all_items' => __('Alla Recept'),

    'view_item' => __('Se Recept'),

    'search_items' => __('Sök Recept'),

    'not_found' => __('Inga Recept hittade'),

    'not_found_in_trash' => __('Inga Recept hittade i papperskorgen'),

    'parent_item_colon' => '',

    'menu_name' => 'Recept',

    ],

    'description' => 'Holds our Recept and Recept specific data',

    'public' => true,

    'supports' => ['title', 'editor', 'thumbnail', 'excerpt', 'revisions'],

    'has_archive' => true,

    'taxonomies' => [],

    'hierarchical' => true,

    'menu_position' => 2,

    'rewrite' => ['slug' => 'recept', 'with_front' => false],

    ]

    );

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter hirngesicht

    (@hirngesicht)

    Feel free posting back if I missed something, I wrote this in quite a rush unfortunately

    We host our site with Trellis on Hetzner. We use the Sage 10 theme, with Bedrock.

    Hi @hirngesicht,

    Please accept our apologies for the delayed response.

    After reviewing the issue with our team, we can confirm that the current tracking structure does not properly support archive pages, such as custom post type archives and date archives, as these pages lack unique ID.

    We appreciate you bringing this to our attention, and please rest assured that we are actively working on a workaround to address this matter.

    Thank you for your understanding and continued support!

    Regards,
    Matthew

    Thread Starter hirngesicht

    (@hirngesicht)

    You people are on fire! Keep it up!

    I’ll be transferring them to Pages to fix this, so don’t feel any obligation to fix this just for us 🙂

    That’s very kind of you, @hirngesicht!

    We are dedicated to providing you with the best support possible and ensuring a smooth experience for all our users.

    Regards,
    Matthew

    Matthew

    (@mhdizmni)

    Dear @hirngesicht,

    I wanted to provide you with an update regarding this issue.

    We are planning to address it in version 15, though it is still tentative at this stage.

    Thank you for your patience, and please don’t hesitate to reach out if you have any further questions.

    Best regards,
    Matthew

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Archives using a content template in Bedrock isn’t measured properly’ is closed to new replies.