Home Forums Gutenberg How do I place post-specific ACF Gutenburg block in sidebar?


How do I place post-specific ACF Gutenburg block in sidebar?

  • On my website I have an archive of news stories that I wrote during my previous career as a journalist.

    All of these posts have a custom Gutenburg block that includes metadata about the print version of the article. Right now that block appears within the main site content area beneath the headline, however, I would like it to appear in the sidebar.

    Here is an example of one of those posts:

    Secondly, here is an example of what I would like to do:

    You’ll notice that this post has post-specific content in the sidebar.

    Here is the block in question:

    					'name'              => 'pdfdownload',
    					'title'             => __('PDF Download'),
    					'description'       => __('A block for PDF downloads.'),
    					'render_template'   => 'template-parts/blocks/pdfdownload/pdfdownload.php',
    					'category'          => 'formatting',
    					'icon'              => 'media-text',
    					'keywords'          => array( 'PDF', 'Download' ),
    /* PDF Download */
    $pdf_download = get_field('pdf_download') ?: 'PDF Download';
    $newspaper_clipping = get_field('newspaper_clipping') ?: '';
    <div class="print-version">
    <span class="print-version-meta">
    	<h6><span class="print_version_headline"> <? echo "Print Version" ?> <a href="<?php the_field('pdf_download'); ?>">(Download PDF)</a></span></h6>
    <span class="news-clipping">
      <a href="<?php echo $pdf_download; ?>"><img src=" <?php echo $newspaper_clipping ?> "></a>

    Thank you in advance for any guidance!

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.