Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #574894

    Hi
    I’m new at creating custom type posts, so hopefully I have explain my issue well.

    I’m currently developing a blog type website. I created a custom post type “surmespieds” following the Enfold video instructions, then added the recommended ALB code to my functions.php within my Child Theme that points to my custom post type “surmespieds”. All worked so far.

    I seem to no be able to see the standard post meta elements, so I found and followed the instructions in this ticket #572879 by creating the post_meta_infos.php file. However, I does not seem to display the meta data.

    You must login to view the development website, so I have included those below.
    The website can be found here: http://techweb.wpengine.com/ (hosted on WPengine)
    The custom type post is this one: http://techweb.wpengine.com/surmespieds/grandir-avec-la-meute

    Thank you
    Lyse

    #576469

    Hey tremblayly!

    Are you sure it’s the right link? It say’s “Nothing Found”. Please share the wordpress admin login info in private content so we can login and take a look.

    Cheers!
    Vinay

    #576536

    Hi Vinay,

    Perhaps because its in draft only. You will find the custom post type under MesPieds in the admin sidebar.
    I’ve added credentials below.

    Thank you
    Lyse

    #578850

    Hi!

    is the code snippet working when you deactivate all your plugins? Cause maybe your Types plugin is not compatible.

    Regards,
    Andy

    #578877

    Hi Andy,

    I have 3 plugins: Akismet, UpdraftPlus, and Types. I deactivated each plugin one at a time. The last one was Types, so of course, because the post is a custom type post created with the Types plugin, it is not accessible once the plugin is deactivated.

    I reactivated my plugins.

    Lyse

    #579563

    Hey!

    Can you post a link to the ticket you mention? also, what are the custom meta names you are trying to show?

    Regards,
    Josue

    #579672

    Hi Josue,
    Here are the links to two tickets I used to help me create my custom post type:

    https://kriesi.at/support/topic/how-to-add-blog-meta-information-to-posts-designed-with-the-advanced-editor/
    https://kriesi.at/support/topic/displaying-custom-post-types-inside-of-the-avia-layout-builder/

    What I’m trying to display are the standard post meta data, i.e. date, comment, category, author, share entries, leave a reply, replies
    These do not show up on my custom post types.

    Thanks
    Lyse

    #580144

    Hi!

    If the advanced layout builder is used for custom post type or the default posts, the default elements, including the post meta info, will not be included. Unfortunately, there is no specific element for the post meta info so you have to create it manually. Create a new php file, name it “post_meta_infos” then insert the code from the following pastebin. Save then you should see the new element named Post Meta in the advance layout builder: http://pastebin.com/qsXmPDQJ

    Best regards,
    Ismael

    #580584

    Hi Ismael,
    I already created that file using that same code. I uploaded it to my child theme folder via FTP. None of the elements display.
    Thanks
    Lyse

    #580716

    Hey!

    Try adding this at the very end of your theme / child theme functions.php file:

    function custom_shortcode_func() {
    	ob_start();
    	echo "<span class='post-meta-infos'>";
    	echo "<time class='date-container minor-meta updated'>".get_the_time(get_option('date_format'))."</time>";
    	echo "<span class='text-sep text-sep-date'>/</span>";
    
    	    if ( get_comments_number() != "0" || comments_open() ){
    
    	    echo "<span class='comment-container minor-meta'>";
    	    comments_popup_link(  "0 ".__('Comments','avia_framework'),
    	                          "1 ".__('Comment' ,'avia_framework'),
    	                          "% ".__('Comments','avia_framework'),'comments-link',
    	                          "".__('Comments Disabled','avia_framework'));
    	    echo "</span>";
    	    echo "<span class='text-sep text-sep-comment'>/</span>";
    	    }
    
    	    if(!empty($cats))
    	    {
    	        echo '<span class="blog-categories minor-meta">'.__('in','avia_framework')." ";
    	        echo $cats;
    	        echo '</span><span class="text-sep text-sep-cat">/</span>';
    	    }
    
    	    echo '<span class="blog-author minor-meta">'.__('by','avia_framework')." ";
    	    echo '<span class="entry-author-link" '.avia_markup_helper(array('context' => 'author_name','echo'=>false)).'>';
    	    echo '<span class="vcard author"><span class="fn">';
    	    the_author_posts_link();
    	    echo '</span></span>';
    	    echo '</span>';
    	    echo '</span>';
    	echo '</span>';
    	$output = ob_get_clean();
        return $output;
    }
    add_shortcode('the_post_meta', 'custom_shortcode_func');

    Then use [the_post_meta] to show the post meta.

    Cheers!
    Josue

    #580728

    Hi Josue,
    I added the [the_post_meta] in as code content in the custom post type and I’m now able to see the post date, comments, and author. How do I get the remaining post meta: tags, share entry, you may also like, replies, and leave a reply, logged in as, and post a comment?
    Thanks
    Lyse

    #580994

    Hey!

    For tags:

    function custom_shortcode_func2() {
    	ob_start();
            echo the_tags('<strong>'.__('Tags:','avia_framework').'</strong> ');
    	$output = ob_get_clean();
        return $output;
    }
    add_shortcode('the_post_tags', 'custom_shortcode_func2');
    

    For the rest you can use ALB elements (share, comments).

    Regards,
    Josue

    #581156

    Hi Josue,

    For the tags, I added the code to my functions.php and added another block element with [the_post_tags] but nothing displays.

    I successfully added the share and comments and that works well.

    How do I get to display the related posts

    Thanks
    Lyse

    #581799

    Hey!

    Make sure there are Tags associated with the Post being shown. Regarding showing related posts you could use a Portfolio/Masonry set to show items from a specific Tag.

    Regards,
    Josue

    #581815

    Hi Joshue,

    I’ve got the tags displaying. I had forgotten to add the taxonomies to the custom type.

    I will try the suggestion you’ve done.

    Thank you so much for all of your great help!
    Lyse

    #581824

    You are welcome Lyse, glad to help :)

    Regards,
    Josue

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘Using ALB with custom post type and meta information’ is closed to new replies.