Jump to content
Eugenio

Custom fields in Post Metabar

Recommended Posts

Eugenio+    1
Eugenio

Hello, I want to show the content of a custom field in the post metabar. Is it possible?

Is there a shortcut?

 

Share this post


Link to post
Share on other sites
catrina    103
catrina

The post metabar only accepts the shortcodes provided by PageLines, but it should be possible to display the content of a custom field somewhere else in the post area. Please see for further info: http://codex.wordpress.org/Custom_Fields


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
Eugenio+    1
Eugenio

Thanks Advocate, but is too much for me. I´m creating a calendat of events an only want to show in the blog a list of Image, Title and date (this is in the future). If it´s imposible in the meta, i´ll try how looks in the excerpt. 

Share this post


Link to post
Share on other sites
johnny_n    0
johnny_n

This doesn't seem to work.  I'm trying to output a break to split the metabar up into two lines for legibility.

 

 [post_date] [custom_break]Categories:

 

 

The function is simple, (I've tried both with '<br /> and 'n' but that's not the issue:

 

 

function custom_break_func($atts) {
	echo "<br />";
}

add_shortcode('custom_break', 'custom_break_func');

 

 

What happens is it's not output in the metabar but above it, right after the copy-pad div:

 


<div class="copy-pad"><br /><article class="post-623 post type-post status-publish format-standard hentry category-events...


 

 

I discovered this by outputting a word, instead of the break.  For some reason the underscores are being removed from the function above but they are there.

Share this post


Link to post
Share on other sites
James B    436
James B

Hi Johnny 

 

Could you please create a new thread if you need help with this one, as this thread has been marked answered already, any further responses might not be seen by the moderator team.

 

As you're a member of the Pl Developer group you might also be able to check in the skype clan chat to see if anyone knows the answer on the underscores being stripped out. Otherwise drop a new thread and we'll try and check with the core dev's for you.

  • Like 1

Kindly search the forum and read the documentation before posting. It will help you resolve many issues.

For CSS help be sure to check out W3Schools first and be sure to download FireBug for FireFox for troubleshooting.

James B

Share this post


Link to post
Share on other sites
Simon    247
Simon

johnny_n Soory but your doing_it_wrong() ;) Shortcodes should never EVER output anything, the function has to return it back. for example:

function custom_break_func($atts) {

    return "<br />";

}

add_shortcode('custom_break', 'custom_break_func');

  • Like 1

Share this post


Link to post
Share on other sites
johnny_n    0
johnny_n

Fantastic.  Thank you James and Simon - this works beautifully.  Others might find a use for this as well.

 

Appreciate the lesson too, Simon - I had read the Codex shortcodes page a couple of times but your statement is to the point!  :-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Similar Content

    • bross51
      By bross51
      I was able to hide the metabar on the single post pages thanks to the included shortcodes however there are no shortcodes to hide the metabar on the remaining pages.  How can this be done?
       
      Thanks for the help.
    • seanocaside21
      By seanocaside21+
      Hi Guys,
      I am using category page to display all posts from a single category. However each post has a child category that separates each post into individual categories, in this case by county.
      Basically i am wondering is it possible to hide the parent category from the meta bar and just show the child?
      Thanks,
      Seán
    • sethoof
      By sethoof
      I am trying to post research paper abstracts for a client and have created a custom post type for doing so using Custom Post Type UI plugin. But I do not know how to customize the pagelines metabar in these posts to remove the date and comment link.  Ideally, I would replace these with some of the custom metadata (paper-author, paper-topic), but if that is not easy to do with custom css, I can just remove the metabar all together and put the info into the post content.
       
      This is the code I want to change as identified by firebug.
      <div class="metabar">
      Posted <time class="date time published updated sc" datetime="2014-04-18T07:30:14+00:00">April 18, 2014</time> · <span class="post-comments sc"> <a href="http://cidrzfoundation.flywheelsites.com/paper/zambian-womens-attitudes-toward-mass-nevirapine-therapy-to-prevent-perinatal-transmission-of-hiv/#comments">Add Comment</a> </span> </div>   Thanks in advance for any help!
    • rijans
      By rijans
      Why author link in metabar points to home site link? It should point to mysite.com/author/alex   ... right? but it is pointing to home page mysite.com . How do I solve this problem?
    • massmosaic
      By massmosaic
      Hi Pagelines staff,
       
      I believe I'm misunderstanding or misusing the "styling classes" field on the front-end editor... 
       
      I'm looking to remove the author username and "add comments" from my forum pages. Here's the url: http://rad.mosaicearth.com/discussions/community/
       
      I've found the correct class via firebug, and tried the following code on the custom frontend code editor, which works:
      .post-meta .metabar {display: none;}
       
      However this removes this metabar across all pages of the site. I would like to keep it in the posts of the site, and only want to remove on the forum pages....
       
      So I went to the "Section Options: Type" and "Section Options: Local" areas of this page and added this code into the styling classes box... but nothing is removed.
       
      Is this the correct use of the "styling classes" field??  If not, what is this area used for?? Also, I assume that "section options: type" will apply changes to that custom post type (bbpress pages) but am not sure.  I checked the Pagelines documentation and don't see any information on the Styling Classes field.  Any advise or references here is much appreciated.
       
      Thank you.
       
       
×