• Resolved ozgurerdogan

    (@ozgurerdogan)


    I created a new cpt but when I view page, I only see title and content. No extra fields’ data. Is this because theme I use. Or I need to do some thing extra?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Paul Clark

    (@pdclark)

    Frontend page output will depend on your template.

    A theme’s template can be edited, or Pods as an Auto Templates tab to add to the default content using templates with magic tags.

    Templates can also be set using the Pods blocks in Full Site Editor based themes.

    Thread Starter ozgurerdogan

    (@ozgurerdogan)

    Thank you. I sorted it out. But is there a FREE drag and drop template builder for pods?

    Plugin Support Paul Clark

    (@pdclark)

    @ozgurerdogan At this time, there has not yet been a developer who has written a graphical editor which supports all possible data types available in Pods and given it away for free.

    The closest thing is the Pods Shortcode, which is supported in most all editors and WordPress contexts, or the paid plugin which converts the Pods Block Editor blocks to be compatible with many popular page builders.

    One alternative may be to embed Block Editor content into other page builders, e.g., with this shortcode used like [embed-post slug="slug-of-any-post-from-any-post-type"]

    <?php
    add_shortcode(
    'embed-post',
    function( $atts, $content, $tag ) {
    $post_from_slug = get_posts(
    'name' => $atts['slug'],
    'post_type' => 'any',
    'post_status' => 'publish',
    'posts_per_page' => 1,
    );
    if ( array_key_exists( 0, (array) $post_from_slug ) ) {
    return $post_from_slug[0]->post_content;
    }
    return '';
    }
    );
    Thread Starter ozgurerdogan

    (@ozgurerdogan)

    Thank you. Even simpe bootstrap editor helps…

    Plugin Support Paul Clark

    (@pdclark)

    Great, good to hear.

    If there are shortcodes or other filtered functionality in the posts being embedded and they do not load, the line:

    return $post_from_slug[0]->post_content;

    would be changed to:

    return apply_filters( 'the_content', $post_from_slug[0]->post_content );

    Blocks without shortcodes or other legacy filters would not need the filters. The above change will cause the_content filters, such as shortcode processing, to run twice — once on the embedded content, then again when the page builder outputs its results.

    That may resolve some issues or add some flexibility, but may also cause unexpected results depending on the particular mix of editors, plugins, etc. Keeping things simple usually yields the best results.

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