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

learn more… | top users | synonyms (1)

0
votes
1answer
735 views

PHP Widget and do_shortcode

I'm using PHP Widget which allows PHP code to execute from a widget. I tried using this code to execute do_shortcode but it's not rendering <?php $lat = get_field('woo_maps_lat'); $long = ...
1
vote
0answers
229 views

List authors with the last post title and order by last post date

I want to list authors with last post data and order them by last post date. Now i have this codes but i don`t know how to edit them. // Selects from tables wp_users and wp_posts, selecting published ...
0
votes
1answer
173 views

Menu not styling. New menus functionality giving me a headache

I can't find a good tutorial on the new menu handling functions, and the ones I found don't seem to work for me. What am I doing wrong? In my functions.php: (I'm using the Blank Slate theme as a ...
1
vote
1answer
850 views

Using WP Category Lists Plugin to Dynamically Display Category (PHP)

I am trying to use the Category Posts (WP-CPL) plug-in on a blog I'm working on to filter 'Recent Posts' by category. Basically, when someone clicks on the category name on the blog, I would like it ...
0
votes
1answer
799 views

Pulling Advanced Custom Fields from other pages

Basically I am using Advanced Custom Fields and have an ajax tabbing system that works with the ACF. The current set up is below: <ul class="css-tabs"> <li><a class="current" ...
0
votes
3answers
156 views

Only show image from custom field when present

How would I adjust the following code to only show the image tag when there is a variable present in the "imageembed" field? <?php $imageid = get_post_meta($post->ID, 'imageembed', true); ?> ...
0
votes
1answer
99 views

Cinema site, retrive the movies that actor play in

Hy, im building a cinema site in wp... For movies - I am using POST - The movies are post there.. For actors - I am using post_type : persoane , Taxonomy : lista. Ex: In post i add the movie, with ...
1
vote
1answer
2k views

Drop down+sort blog posts date added/most popular

Is it possible to have a drop down menu like youtube/demonoid that allows you to sort your index (and caterogy.php) blog posts by date/popularity/viewed)? I seen plugins for adding most popular ...
1
vote
0answers
116 views

Automatic Shortcode Creation with Custom Fields

This is basically a php issue as I'm fairly new to it and can't figure out how to code things the way I want. I am basically trying to pull information from custom fields (grid reference) and post ...
0
votes
1answer
155 views

Getting a specific “title for a section” only on Startpage?

I have a website which shows alle posts from my wordpress on the startpage. thanks to Stephen Harris who helped me with this code I put in the functions.php: ...
0
votes
1answer
230 views

Load Javascript from Plugin in One Page Only?

I use the ALO EasyMail Newsletter. But the plugin is loading lots of Javascript in the head. I have a mobile site and the scripts are loading in all the pages. I think this affects the mobile ...
0
votes
2answers
317 views

Get category id when SEO URL is turned on

<?php /* Plugin Name: Members */ function myFilter2($query) { if ($query->is_category) { $currently_listing_categories = ...
0
votes
1answer
408 views

Get date function not working

I have a function to get the date. I have input fields and want the date in this fields. But my code is set a wrong date. I set the date in Wordpress settings and on my server. But it is not working. ...
0
votes
1answer
253 views

if is_home(), change class of menu-item-225 of wp_nav_menu

Thanks for taking the time to check this out. I know it's outdated, but I'm using Wordpress 3.2.1. I have a Custom Home Page - where I created a Page for it and titled it as my Home Page with the ...
1
vote
0answers
161 views

Passing the page ID to a login php script

I'm trying to create a simple registration process which goes like this, A visitor clicks on a link (which is viewable only after entering some information such as name, email, phone etc.) This ...
0
votes
1answer
436 views

Why use foreach to get attachment_id if numberposts is equal to 1?

I needed to pass an image to a Pinterest plugin in posts without a Featured Image so I wrote a little function to get the id of the first picture in a post. This code is in the loop-single.php where ...
7
votes
1answer
5k views

How does printf( __( ) ); work?

Today I work through a theme to get a better understanding of WordPress and templating. I discovered this: <?php printf( __('Designed by %s', 'Anyword'), '<a ...
0
votes
2answers
53 views

How to include custom code on a page that's set to act as homepage?

I have a page called 'home' which is set to be the front of my site, but I'd like it to show the most recent blog post or two at the bottom. I have some PHP that will do this from another site ...
2
votes
1answer
3k views

Woocommerce Custom CSV export

I've been trying to figure this out for the past few days. Is there a plugin that exports CSV with the Order Items all on the same line but not in the same column cell? Example: Item Name_01, Item ...
0
votes
1answer
280 views

WordPress most commented posts of last X days

I'm working on implementing a WP feature that shows the most commented posts from the last X days (e.g. lat 2 days). I've used the following code I found on the web (and here on SO), which does the ...
2
votes
3answers
2k views

How to Add Custom Fields to Custom Taxonomies in Wordpress CLEANLY

Saving extra fields that were added to a taxonomy. I want the most proper & efficient way of doing so. Where should I save the new fields? 2 possible solutions are to 1) Use the Wordpress ...
0
votes
1answer
40 views

images in wordpress themes

I am developin a theme in php using wordpress.I want to display images on the website . so my question is what will be the best practise 1)store the image itself in a table using an "image" or ...
1
vote
2answers
6k views

Wordpress redirect to landing page if not logged in

I'm using the following code in my functions.php file to redirect users who are not logged in to a particular landing page <?php if(!is_user_logged_in()) { wp_redirect( ...
0
votes
1answer
93 views

Nav Menu Display

Hi I'm wanting to create a custom navigation menu that will require creating 2 div containers to hold the SUB-MENU set. In other words I want to do this: <div id="access"> <div ...
5
votes
2answers
724 views

Can i use php sql functions instead of $wpdb?

I'm new to WordPress and was wondering why in WordPress API do they tell you to use functions such as prepare(), insert(), get_col(), get_row(), query(), etc. when technically I can use the built-in ...
0
votes
1answer
153 views

Need help getting this page nav working correctly

For some reason the page nav doesn't work correctly. It's styled odd on the home page (http://noahsdad.com/), then if you go to a page (say page 2 for instance, http://noahsdad.com/page/2/) you'll see ...
0
votes
1answer
105 views

split searchresults into different topics?

How could I split the searchresults into topics. I have e.g. three Topics - cars | computers | culture all are "custom post types" . Now a user searches for term "speed" in the searchbox and the ...
2
votes
4answers
368 views

Filter link to existing content suggestion

How can i filter the link given in "link to existing content". Eg: As in the above image. I just want WSP BANNER TO BE SHOWN. where WSP BANNER & CALENDAR are custom POST types Any help will ...
1
vote
2answers
468 views

PHP Code stuck in Cache [Memcached] [closed]

Been having a bit of a problem with my site regarding our caching method and my php code not refreshing or flushing. To start, my site is on a dedicated Nginx webserver. I used W3 Total Cache for ...
0
votes
2answers
51 views

Page template is accessing the incorrect posts?

Hi I'm attempting to create my own custom template that will have a format like this: <?php get_header(); ?> <div id="container"> <div id="top-half"> <!--fixed ...
0
votes
2answers
420 views

Styling an “active” link outside of Wordpress default menu

I want the background-color of the selected box on this page to display gray color once the user lands on the corresponding page. My link is currently setup inside of the page template itself as a ...
0
votes
1answer
634 views

Wordpress & PHP sessions

I am using a plugin called WP events manager, I would like to add custom functionality so that each event can be 'added' to a 'basket' then at the end the user can go the the 'checkout' and register ...
1
vote
2answers
305 views

Selectbox in admin panel function linking to CSS

I want to link the selectbox to my CSS. Like if I click an item on the list, the background of my header will change - the header's color is in the CSS. The selectbox isn't in the html but it's in ...
1
vote
1answer
612 views

Compare post-IDs within WP_Query? (Less than / Greater than)

Can I use WP_Query to only query posts less than (or greater than) a given post ID? $filtered_query_args = array( 'post_type' => 'projects', 'order' => $prev_next=='next' ? 'DESC' : ...
0
votes
1answer
69 views

retain querystring values when savincustom options in admin

Quick question, I have a custom options page which posts to options.php, however I have a few sections to my options page where i change the post url like so: <form ...
1
vote
1answer
123 views

which action to hook to in order to perform post-publish action

I have some functionality I've written in order to post the title and link for the post to twitter whenever a post is published. I'm wondering which wp function to hook this to? save_post has no real ...
2
votes
1answer
1k views

Bulk Image upload and one image for each post?

I have around 3000 photos, want to upload on WordPress. Is there any way to bulk upload all the photos as one image for each post ?
0
votes
1answer
168 views

Issue with custom plugin

I created an audio player in HTML5/Flash with the help of the SoundManager2 API. Now I want to add it to Wordpress as a plugin, so that you don't need programming skills to customize the player. The ...
1
vote
1answer
40 views

Getting trackpacks/pingbacks for a post via wordpress?

Is there a way for someone to query the wordpress API of a blog in order to get the pingbacks/trackbacks for a post? E.g a blog is hosted on example.com. I want to query example.com's wordpress API ...
0
votes
1answer
283 views

Setup page template array in a custom post type

Hi below is a 'case' (in a custom post type) for pulling all categories and displaying them as a drop-down menu. How can I do the same but turn it into a list of checkboxes? //tax_select - this ...
0
votes
2answers
191 views

How do I add my PHP app to a Wordpress page whilst keeping semantic URLs?

I am rebuilding a static website for a client using Wordpress on the main domain- eg domain.com. There is also a directory of members website at directory.domain.com which I was hoping to migrate over ...
-2
votes
2answers
290 views

Upgrade wordpress core programmatically with PHP [closed]

What I want to do I want to upgrade Wordpress programmatically to a later version. That I want to do with PHP, lets say from http://www.example.com/?upgrade_wp=true I already know how to get the URL ...
0
votes
2answers
345 views

Saving fields in a drop-down in Wordpress

Below is code that successfully displays a drop-down menu of page templates in my Wordpress theme. I'm using this menu in a custom post type, and don't quite understand how to label it in order to ...
2
votes
4answers
91 views

Get list of WP Updates Across Sites

Is there a way to query a WP site to see the number of updates currently available? I'm not really looking for a list of the actual updates, just the number. This would be the total number of ...
10
votes
1answer
2k views

How can I use WordPress functions in my stylesheet?

I have my style.php file looking like this. <?php header('Content-Type: text/css');?> #div{ background:<?php echo get_option('bgcolor');?>; } This does not work, but when I do ...
1
vote
1answer
1k views

How to put JQuery/Ajax inside shortcode?

The purpose of this plugin is to create a list that users can modify with up or down votes. The shortcode is supposed to display the list on a page and use JQuery to fadeIn and fadeOut while updating ...
0
votes
1answer
155 views

PHP if statement works in template files, but not header

This is driving me nuts, and I'm sure that as soon as someone points out the answer, I'm going to feel dumb. I have a website where most pages require login to view. So I am using an if statement to ...
2
votes
1answer
918 views

How to edit/delete single row items in a table on my own menu page

I have successfully created a wp-LINKS-list-table that displays the output of WP's core "Links" table in the WP Dashboard, and I have it displaying on a menu page I created. Step 1 accomplished! ...
0
votes
2answers
1k views

Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view

I have a custom-post-type named wr_events. I have quite a lot of meta-boxes in this post-type. The post-type and the meta-boxes itself work just fine. Only thing: No matter at what post-type I ...
0
votes
1answer
137 views

How Can I Edit the Registration Code?

I would like to add a group of two radio buttons to Wordpress's registration page (yes and no), where if yes is selected the value in the email field will be added to an aweber mailing list. Would ...