-
AuthorPosts
-
January 30, 2016 at 3:50 am #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-meuteThank you
LyseFebruary 2, 2016 at 3:23 pm #576469Hey 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!
VinayFebruary 2, 2016 at 4:37 pm #576536Hi 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
LyseFebruary 5, 2016 at 11:34 pm #578850Hi!
is the code snippet working when you deactivate all your plugins? Cause maybe your Types plugin is not compatible.
Regards,
AndyFebruary 6, 2016 at 12:22 am #578877Hi 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
February 8, 2016 at 1:13 pm #579563Hey!
Can you post a link to the ticket you mention? also, what are the custom meta names you are trying to show?
Regards,
JosueFebruary 8, 2016 at 3:06 pm #579672Hi 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
LyseFebruary 9, 2016 at 7:02 am #580144Hi!
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,
IsmaelFebruary 9, 2016 at 9:23 pm #580584Hi 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
LyseFebruary 10, 2016 at 1:54 am #580716Hey!
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!
JosueFebruary 10, 2016 at 3:46 am #580728Hi 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
LyseFebruary 10, 2016 at 11:26 am #580994Hey!
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,
JosueFebruary 10, 2016 at 2:58 pm #581156Hi 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
LyseFebruary 11, 2016 at 6:20 pm #581799Hey!
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,
JosueFebruary 11, 2016 at 6:36 pm #581815Hi 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!
LyseFebruary 11, 2016 at 6:58 pm #581824You are welcome Lyse, glad to help :)
Regards,
Josue -
AuthorPosts
- The topic ‘Using ALB with custom post type and meta information’ is closed to new replies.