Display CPT using simple shortcode

Support General Display CPT using simple shortcodeResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #19413
    @mindspark@mindspark
    Participant

    Normally I use Beaver Themer to display CPTs, but in this case, I have a site that doesn't use any page builder.

    CPT = Announcements (for COVID-19)
    CPT ID = 3621
    Goal = display CPT in an alert bar on every page of the site

    Details = I made an announcement for COVID-19. I plan to display the notice by inserting a simple shortcode in the header.php file. I'm not a PHP coder but I know I can echo a do_shortcode command inside a div in the header.php file.

    My issue is I am trying to first confirm that the announcement can be viewed on the site via a metabox shortcode.

    [rwmb_meta object_id="3621"] isn't working inside the text editor on my test page. see here: https://heartwoodpreserve.com/test/

    What am I doing wrong?

    #19419
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Each CPT has the default archive page http://your-site.com/cpt-singular-slug shows the list post of this CPT. On your site is the link https://heartwoodpreserve.com/announcement/
    so you can insert the link to the archive CPT page in the header.

    For more information, please follow this documentation
    https://developer.wordpress.org/themes/template-files-section/custom-post-type-template-files/

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.