0
votes
0answers
11 views

Creating a filter to modify links ending in .pdf

I'm trying to create a filter that checks for links that are to PDFs, and append the href attribute with something like /form?file=[path to pdf]. For example, starting with: <a ...
0
votes
1answer
32 views

Hide a div when a custom field is empty

I am having trouble hiding a div when the input of a custom field is empty. This is the code I am using but can not seem to get it to work. The field that displays the content is _cmb_fe_wysiwyg ...
0
votes
2answers
70 views

Display custom meta box in my template file

Need help displaying my custom meta boxes on a template file. Following a tutorial Here's the code from my functions.php: function get_custom_field( $value ) { global $post; $custom_field = ...
0
votes
1answer
410 views

Let users upload image(s) to the post from front end

I want to enable logged in users (Wordpress) to submit posts from front end (among with other data). My form is working great, I add custom post meta data which I later display on custom post page. ...
0
votes
0answers
61 views

Problem with checkbox using custom field archive

How can i get archive base a custom field. I try this but my hosting say there is a problem with my code, the code make manny select in the database.. I have 1 post type, and 2 custom field ...
0
votes
2answers
62 views

How to display data from custom fields in my custom shortcode?

This is the shortcode I have come up with, according to a tutorial on Dig WP (http://digwp.com/2010/01/custom-query-shortcode/) in order to display list of songs on specific albums. [loop ...
0
votes
0answers
30 views

Template tag for custom field sub heading in post - error

Im trying to create a template tag for a subheading for a post which is entered as a custom field. This is the function I have: function spost_subheading() { $key = get_post_meta($post->ID, ...
0
votes
1answer
34 views

Syling Custom Fields echo's from from functions.php

With the help of User Borek I've managed to get Custom Fields displaying on my siteby putting the below in the functions.php: function custom_field_before_content() { if(is_page() || is_single() || ...
0
votes
1answer
98 views

How to add content at the end of posts?

I am trying to add custom fields at the end of posts. I succeeded showing the custom content using the below mentioned code. But the main post's content was replaced. : function ...
0
votes
1answer
41 views

Conditional On custom field plugin metabox

I've trying to run a conditional on the custom field I made with the Custom Fields plugin, I made a true and false check box. I just need to check if the box is true or false really. I've tried ...
2
votes
1answer
198 views

Add description text under input field for new profile fields

How can I modify my following code to add some description text under the input fields? I tried modifying it as you can see with the facebook url field but the text shows up under the field label and ...
0
votes
1answer
246 views

saving/reading custom field value does not work - no value gets POSTed

I am trying to add a custom field to all my posts and of course saving/reading the value. As a starting point I took the example from the Wordpress Codex and stripped it down to bare bones. I know it ...
0
votes
1answer
95 views

I want to split this into two functions

This code i will add below is for Custom Fields for Custom Post Type and GMap for Custom Post Type. Currently both are pulled by this function. I want to seperate both. One for Custom Fields and One ...
0
votes
1answer
114 views

Warning: Invalid argument supplied for foreach() [closed]

I have this code from home.php that will going to display a content from a page which has a custom post type of "about" <?php $post_status1 = 'publish'; $post_type1 = 'page'; ...
0
votes
1answer
93 views

Guest Author - How to modify my custom function code if the guest author URL will follow a particular pattern/format?

Based on code the awesome G.M. provided in an earlier question (Use Custom Fields to Create Guest Author Link), I now have a custom function that uses custom fields to support guest authors. The code ...
0
votes
1answer
735 views

Guest Author - How can I use custom fields to create guest author link?

We are posting articles authored by guest authors. The guest authors will not be logging in to the site, and we don't want to create users for these guest authors. We are also not interested in any of ...
1
vote
1answer
110 views

how to put a custom field value in variable

function zh_get_invoice_round_off_number() { global $post; return get_post_meta($post->ID, 'invoice_round_off_number', true); } function zh_invoice_round_off_number() ...
1
vote
1answer
327 views

Auto Populate Custom Field with Complex Value That Increase by One?

Can somebody help me to sort this? I am using WP 3.5.2 and I have "Orders" post type where purchase_order custom field is located. This is the sample of purchase order record: POCOS20130051 PO - ...
1
vote
3answers
2k views

Add input field to 'Pages > Edit Page' through functions.php

Original Question: I'm trying to add an input field to 'Pages > Edit Page'. The use of this input field will be for a user to add an ID of a slider, so that that slider will be page specific. ...
7
votes
2answers
2k views

Programatically add options to “add new” custom field dropdown

How can I add pre-defined options to the "add new" custom field dropdown? Here's two examples of automatically adding and showing new custom fields: WordPress: Adding Default Custom Fields on New ...
0
votes
1answer
81 views

How can I create a menu items from meta box based on users input

I have created a metabox that takes a name that the user can give as an additional name of their post. I am wondering how I can automatically create a menu item based on the name the user input into ...
1
vote
1answer
31 views

Trying to retrieve post meta

I have created a meta box that allows users to add an additional name/id to their post. From what I can tell it is adding the meta information correctly because when I edit a post that has a custom ...
0
votes
1answer
384 views

Get post meta retrieving wrong value

I created a custom meta box with a textbox where the user can enter a custom value in as an additional identification tag. I thought I had it right but when I try to retrieve the value it is giving me ...
0
votes
1answer
86 views

Perform function on publish AND save (not just save)

I am using this function to auto-set a post title based on a couple of custom fields: function set_event_title( $data , $postarr ) { if($data['post_type'] == 'event') { $getdate = ...
0
votes
1answer
269 views

Saving multiple Metabox contents

I'm putting together a fairly simple Custom Page for a friend on their WordPress site, but I'm having some real difficulties getting the contents of the Metaboxes to save correctly. WordPress doesn't ...
1
vote
1answer
265 views

Custom Metabox Not Saving

I've simplified a problem of saving custom metaboxes on update and still can't get the box to save the custom-field input to the database. This is the call from functions.php to an external file ...
0
votes
2answers
827 views

Excerpt length: get first paragraph

I'm trying to figure out if it's possible to get an excerpt from each post, grabbing the first paragraph from each one. I'm currently using the ACF plugin and have custom post types and custom fields. ...
0
votes
1answer
246 views

Custom metabox not working

Morning! I have a call in my functions.php file to include a custom meta-box php file in my theme's directory called: /metaboxes/home-meta.php The code is as follows for the call: add_action( ...
1
vote
2answers
1k views

can you set a default value to a custom field

I'm looking to set a default value to a specific custom field, in case the client doesn't add into the custom field it already has a specific number associated with it. one step deeper, I'd like it ...
0
votes
2answers
119 views

How can i call from custom fields to the category editor?

I found this code for custom field add category editor. I added custom field to the Category. e.g. My field name is Hastag and i have a Sport category. And i want to call display Sport's custom ...
0
votes
3answers
219 views

Display a custom field rating system in the front end

I have added a content rating system to my platform where the authors can select which audience their post is appropriate for. Currently, these options are available: Unrated G PG ...
2
votes
1answer
257 views

WP doesn't show Array Custom Fields?

I'm wondering why WordPress doesn't list PHP array() and any serialized data in Custom Fields in Admin Panel (for Pages, Posts etc.)? Only Custom Fields containing strings and numbers show up and can ...
0
votes
2answers
340 views

Hide custom fields when empty

I am trying to create a function to add data from two custom fields after the entry title. I get it to show correctly when these fields are filled in. The fields are a image source url and an url the ...
1
vote
2answers
223 views

Getting the ID of any image for use in functions.php

I've added two custom fields to attachments on my site, so the user can add a special image credit. I'm trying to write a function that looks to see if either of the custom fields are populated, and ...
0
votes
1answer
37 views

Specific coditional usage [closed]

I have some trouble making work a conditional inside a Function. check this out: I'm using this function: function get_spec_1(){ $desc1 = get_post_meta( get_the_ID(), 'eco_mb_tp_1', true!= "" ); ...
0
votes
1answer
459 views

Add custom fields after post/page title

I am using the Headway theme, and I need to add custom field code to page & posttitles. This is what I need to be able to do. The red button will be added through a custom field. It needs to be ...
1
vote
1answer
1k views

How to add a predefined custom field without using a plugin?

I´m trying to find a snippet to add a predefined custom field. Does anyone know how or where i can find this? I know I can do this with CustomPress, but I´m trying to do this without a plugin.
-1
votes
1answer
107 views

How to automatically create a custom field when a post is published?

I'm trying to add custom fields on post publish with this code which I added to my functions.php : add_action('publish_page', 'add_custom_field_automatically'); add_action('publish_post'. ...
0
votes
1answer
174 views

Adding class to last list item? Not WP generated

this one has been getting me for a while. At the moment I have a repeater field with Advanced Custom Fields: <ul id="servicelist" class="clearfix"> <?php if(get_field('homepage_service')): ...
0
votes
1answer
64 views

Allow authors to create article image

I want to allow contributors to upload images while creating posts. But the catch is, I am building the post display pages out of my own custom PHP. Every article written will follow the same ...
0
votes
2answers
292 views

Automatically assign a custom post to a custom taxonomy based on custom field value

We have a custom post type called listings, and each listing has a custom field zipcode (which is a 5 digit number). We then have a custom taxonomy area, which can be "New York", "Los Angeles" etc. ...
0
votes
1answer
85 views

Meta boxes not displayed, data isn't being saved

As the title says, I have a problem in functions.php (I assume it's in there) which causes custom fields to not be displayed on the new/edit post page, and when I add the meta box myself and save the ...
4
votes
3answers
1k views

clients list using wordpress

I am using wordpress for my new website and i have list of clients(name and their logos). I am confused how to make those editable using wordpress? Html as follows... <ul> <li><img ...
1
vote
1answer
222 views

Wordpress metaboxes - textfield suggestion automatically populated

[Long story short] Is there any Wordpress plugin/function that would allow the creation/integration of a metabox's textfield that automatically populates a dropdown menu (in the admin area, while in ...
5
votes
4answers
2k views

Does Wordpress have a “Form API”

I do most of my development in Drupal, however I am working on a Wordpress site and I need to make a form. Which got me thinking, is there a Form API for wordpress like there is Drupal? Is there a way ...
0
votes
2answers
701 views

How to disable Edit Post and Allow only Custom Field?

What I would like to know is if it is possible to disable the edit post function in wordpress based on User's roles. I try to explain better. Let's take an 'Editor' as role example: I would like ...
0
votes
1answer
190 views

Stripping and/or altering the content of a custom field (video URL)

I’m making a theme where some posts have an associated video, from either Vimeo or YouTube. At the moment, users can add this to a post by adding a video ID into one of two custom fields, called ...
2
votes
3answers
1k views

Search everything (posts, pages, tags, cpt, meta)

I would like to know how to use the built in wordpress search to return results from all content on my site. Specifically, I want to search; posts pages tags custom post type (portfolio) custom ...
1
vote
1answer
357 views

Auto-remove custom field with no value on publish

I got some plugins that auto-generates custom fields. Does anyone know how to automatically remove empty custom fields from post when I press "publish"? A check I can put in my functions.php that ...
0
votes
1answer
95 views

grab or load text on demand

What i want to do I want some content (could be stored any where in a post or custom field) to load only when the user clicks for it to load. This content could be any thing (text,images,html etc) ...