The server-side programming language that the WordPress core, plugins and themes are written in.

learn more… | top users | synonyms (1)

0
votes
1answer
721 views

Create new folder and upload files to custom folder via wp_handle_upload

I am using wp_handle_upload to upload files from a theme template file. if ( ! function_exists('wp_handle_upload') ) require_once( ABSPATH . 'wp-admin/includes/file.php' ); $uploadedfile = ...
0
votes
2answers
389 views

Get the alt text of the image in a array

I have a php code. That put the thumbs on the screen. I have this: <?php if (has_post_thumbnail()) : ?> <div class="image"> <?php $attachment_id = get_post_thumbnail_id(); ...
0
votes
1answer
383 views

WordPress TinyMCE Add Button To The Full Screen Mode Editor

I've created a button (named 'quote') in WordPress post editor (TinyMCE) normal mode, and I've been successful in adding some functionality to that button. The question is how can I make this button ...
-5
votes
3answers
651 views

How to store the_post_thumbnail() value in a variable

As you know the result of the the_post_thumbnail() is an image tag. I need this image tag to store at a kind of collection or Array. I'm using the following code but it doesn't help me out. And I want ...
0
votes
1answer
68 views

Restricting Post Content Visibility with Custom Code - where to put it?

We are using custom code (or will be) to detect user groups from our forums to determine whether or not a post's content will be displayed. So if you are someone who has over 500 posts, you are placed ...
2
votes
1answer
528 views

Ajax template: how to handle head section

I know it's easy stuff, but I'm new to this and I can't understand which is the best approach. Background The template I'm working on is a dual theme Desktop/Mobile, UA Sniffing based. Now I just ...
0
votes
2answers
1k views

items_wrap not working

I registered a wordpress menu this way: function nothing_register_menus() { register_nav_menu('header-menu',__( 'Header Menu' )); } add_action( 'init', 'nothing_register_menus' ); I am calling ...
1
vote
3answers
12k views

Include a external PHP file into a Wordpress Custom Template

Is this even possible? I mean, im trying to add a blog into my site.. I already have the header,footer and sidebar layout in my site. can i use those in my custom wordpress template? <?php /* ...
0
votes
1answer
58 views

two sites, same code, different presentation

I have created two web sites. One is "production" and the other "dev". Each is a virtual host and both are on a single server running apache. Both sites are loaded with the same code base: WP 3.5.1, a ...
0
votes
1answer
165 views

Highlight main menu when on specific posts or pages

I am using Genesis and have written a custom function which works fine, but is very ugly and includes a css statement. The object is to highlight a menu link in the main header menu when on certain ...
0
votes
0answers
33 views

WPMU schedule doesn't execute actions

Here's a simple event that is correctly scheduled to be executed daily. Unfortuantely, it doesn't execute delete_old_users() function daily. It is supposed to delete users older than a certain date. ...
1
vote
1answer
60 views

Change Width of Featured Image Thumbnail on Add/Edit Post Page

Does anyone know of a way to change the width of the featured image on the edit post/add post page? I want to make it 50px wide. I'm not talking about the front page of the website, but the back end ...
0
votes
1answer
64 views

WordPress display name string manipulation

I have set the display name to show both first name and last name using the function below. How do I manipulate the LAST NAME to only pull the first letter of that string? Example, if you sign up as ...
0
votes
2answers
33 views

Using Custom Value Options in PHP

I'm currently using a custom field called "Developing" to show whether or not a news story is a developing story. The custom field has a couple of values: a blank option (meaning it is not ...
0
votes
1answer
652 views

Why is my str_replace not working on short code submitted by front-end?

I've built a front-end post submission form that allows a user to include a shortcode provided by SoundCloud. SoundCloud shortcodes generally look like this: [soundcloud ...
0
votes
0answers
43 views

Wordpress links/site title won't work

I have one Wordpress installation at www.website.com, and a test site at www.website.com/test. The standard site works fine, but the links on my test site act weird. I use post title as permalink ...
0
votes
1answer
86 views

how much php coding do i need to know in order to create web blog using wordpress.org

I want to create web blog using WordPress so in order for me to create that blog, what level of php coding do I need to know. At the moment, I'm just learning the basis of php I kind of started ...
0
votes
2answers
647 views

get_post_custom single array

Is there a way to return single values only when I run get_post_custom($post_id); it seems that I'm receiving double array, even when there only one value for this meta_key
0
votes
1answer
1k views

PHP and Jquery pass value from form. Update function on DataBase

i do loop foreach: <?php $myrows = $wpdb->get_results( "SELECT * FROM wp_myprojects" ); ?> <form id="aad-form2" action="" method="POST"> <?php foreach($myrows as $a): ?> ...
0
votes
3answers
74 views

Add Custom Post Type on the Fly or create an array

I have a unique problem I guess. I am working on a site and the client needs to have a way in Wordpress backend from where he can add a post, and from the same page (where he is creating a post) he ...
0
votes
1answer
100 views

PHP: How to access db the right way in plugin?

I thought I would find an answer to my question on the internet but I was not able to. This is not a big question, but as it is my first plugin, I want to make sure that everything is right before ...
0
votes
2answers
157 views

Widgets in the loop if active

I'm trying to put a widget as "first post" if it's active.. and let the posts continue after that.. It works, but the first post disappears and the second post becomes the first in line after the ...
-1
votes
1answer
252 views

Need to call this php function inside a modal window from text widget

Need to call this php function inside a modal window from sidebar text widget <?php echo get_post_meta( $post->ID, 'link', true ); ?>
0
votes
2answers
1k views

the_author() not working outside the loop

I have the following code on index.php and I want to include this line of code (bellow) to display author info on top of the loop. <?php include 'author-top.php'; ?><!--author--> I ...
1
vote
1answer
126 views

How to show a dynamic_sidebar if main content content's height is > a set amount?

I'm looking to add a second dynamic_sidebar to a theme's sidebar.php that will only be displayed if the height of my main content area is greater than a certain amount. If I had some magic hybrid of ...
-1
votes
1answer
230 views

Admin Menu new tab external link

In a clients site i needed to add a menu item under the dashboard, this link is to go to a external url. i managed this with the following code: add_dashboard_page( 'redirecting', 'Docs', 'read', ...
1
vote
5answers
2k views

Get meta_id along with meta_key and meta_value

Is it somehow possible to get_post_meta or get_post_custom and have meta_id returned along with the meta_value? For example: $data = get_post_meta( $post_id, 'my_key' ); // returns this: array( 0 ...
0
votes
1answer
397 views

Best way to extends core classes in theme?

I need to add functions to my WP_User objects, to be used like this : <?php // in my templates : $user = new User($id); $user->sendHelloWorldEmail(); // in my functions.php class User extends ...
0
votes
3answers
1k views

Wordpress Ajax always returns a 404 error

I just got this code from a tutorial. I can't seem to get it to work. HTML (home.php) <form name="myform" id="myform" action="" method="POST"> <!-- The Name form field --> ...
0
votes
0answers
39 views

Some of my php is rendered only when logged as admin

I am using the al-in-one-calendar plugin, and have my own theme for the calendar which worked fine before updating the plugin. In the month view of the theme I am displaying the calendar view and ...
0
votes
0answers
217 views

Add Google Map Stylers to PHP

I would just like to add the following Google Map stylers to my WP maps, but a little lost on where to include in the .twig Here are the stylers: [ { "stylers": [ { "saturation": -100 }, { ...
3
votes
1answer
2k views

Is it safe to use $_SERVER['REQUEST_URI']?

I've looked at other answers and I see that $_SERVER['REQUEST_URI'] is usually recommended and is the accepted answer for getting the current page URI along with $_SERVER['HTTP_HOST']. I looked at ...
0
votes
2answers
891 views

How to fix 'Call to undefined function do_settings()' error?

I am writing my first plugin and to access/save options I follow codex.wordpress.org/Creating_Options_Pages I basically copied the example from 'See It All Together' in a separate file ...
0
votes
2answers
38 views

Detecting if parent page has gallery

My function to detect is a gallery is on a page has broken and Im not sure why. So in my theme template's attachment page Im calling this function: global $post; $parent_id = $post->post_parent; ...
0
votes
0answers
275 views

Download html textarea content as a file

I am working on a project where the requirement is to download a textarea content as a .txt file on a wordpress site. <html> <body> <form action="#" method="post"> <textarea ...
0
votes
2answers
68 views

how to make my website secured

i have a php code inside my website to a quotation form that has java script for making name , telephone number and email rquired fields before submiting the form and its working fine but a few ...
0
votes
1answer
125 views

Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin - Adding to “Thoughts” Theme

How do I enable infinite scroll (either with the infinite-scroll plugin OR the built in infinite scroll jetpack) on the "Thoughts" Wordpress theme? I'm a total noob at editing this stuff so if you ...
0
votes
2answers
428 views

Edit Buddypress Groups Activity Page Text [closed]

I am setting up a Wordpress site with Buddypress functionality for a client. The client wants the "What's new" text under the "Activity" tab changed to something else. I feel like this should be ...
0
votes
1answer
45 views

Editing Theme Files on Wordpress.com-hosted Site [closed]

I'm doing some work for a client on her Wordpress.com-hosted site. I'm used to only working on self-hosted WP sites, and I know how to edit the theme files there, but I'm not sure if it is possible to ...
0
votes
1answer
73 views

Blog page showing same content as homepage

I'm trying to have my posts post on another page(blog) and my 'home' page display as my front page. Both pages have their own templates assigned to them (home for home, blog for blog). In the Reading ...
1
vote
1answer
85 views

Why is this Ajax not working?

I'm not sure if I am abusing WordPress and Ajax by doing it this way but WP and Ajax Codex a well as Plugin Development with Ajax do not seem to be very helpful. I have created the following Ajax ...
6
votes
2answers
2k views

Confirmation box when submitting post for review

A very common issue that I experience with new authors is that they forget to complete a few essential tasks prior to submitting their post for review (even though I have a guide available for them). ...
1
vote
2answers
84 views

Call to undefined method - Download Monitor

I have been working on adding some customizations to Download Monitor So far I have been able to add custom meta check boxes, and save them using the following code. global $post, $download; //add ...
0
votes
2answers
80 views

Skip foreach loop

Here's a little coding problem for you. The code: if ($categories) { foreach ($categories as $tag) { $tag_link = get_category_link($tag->term_id); //new line if ...
-1
votes
2answers
106 views

PHP Syntax getting PHP terms

I'm trying to figure out the php syntax here, so I can show only related products that are of the current taxonomy term. I would like the $args filter 'product_brand' to dynamically grab the current ...
0
votes
1answer
34 views

Outputting a custom field in PHP

I am a complete newbie at PHP so please forgive me. I am wanting to display some data in the following format: "Post name" - "Custom Field String (in this case, 'custom_date')" I am currently ...
0
votes
0answers
71 views

Changes in a home, two columns

I'm working with this template (this is a demo), I need the post shown on the home to appear in two columns rather smaller in width. Enclosed is my index.php code, I've tried everything by various ...
0
votes
2answers
108 views

Displaying posts based on category

I recently got some help here on getting a few posts to display in block format. I was wondering if someone could assist me with modifying the code to limit the posts that show up either by category ...
1
vote
1answer
589 views

How do i calculate the total of values of custom fields in custom post types?

So the title is a bit unclear, but here is what i have: Custom post type: Projects Custom post type: Investments        + Custom field: Amount And i have one page ...
0
votes
1answer
162 views

Catchable fatal error on 3.6 update

Trying to debug the situation. Getting close, but will need a little help!! Here is the error: Catchable fatal error: Object of class WP_Error could not be converted to string in ...