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

learn more… | top users | synonyms (1)

0
votes
2answers
18 views

Display title list of all post of current post type

I have a custom post type called press. I'm on the template single-press.php What I want to achieve is generate a list of the titles (with it's corresponding link to it) of all press custom post ...
2
votes
2answers
314 views

Dynamically add id to heading tags

How do I add an id attribute dynamically to every heading tag on a wordpress website using php? I wanted to make it so that for every heading tag (h1, h2, h3, h4, h5, h6) I have a unique id attached ...
0
votes
1answer
23 views

Multiple do_shortcode in page template

Is it possible to nest multiple shortcodes with do_shortcode? Using visual composer and easytable with the visual editor, the classic editor displays: [vc_row][vc_column ...
1
vote
1answer
38 views

Activate different theme for temporary preview

I wanted that when i access my site with specific parameter, my site used a different theme at that moment (only temporarily, to show only to me as a preview). I want it for test purposes. Is there ...
1
vote
0answers
18 views

wordpress archive a user

Please note this question was originally created in stack overflow. I have moved it here due to recommendation. I apologize if this can be answered elsewhere. I tried searching around with no ...
0
votes
2answers
226 views

Get ID of child from child slug, while knowing parent ID

I have a hierarchy that I need to get data from. It's the child (by slug name) that I need to get while already having knowledge of the parents. Highest Known Parent Page (slug : 'parent') |_ Child 1 ...
-1
votes
0answers
18 views

Remove All in One SEO Pack Widget while posting [on hold]

Im trying to remove or disable All in One SEO Pack Widget while posting for normal editors (not admins) with this code: <?php if (!current_user_can( 'manage_options' )) { function remove_aiosp() { ...
0
votes
1answer
60 views

Bash issue in Podcast Plugin? [on hold]

In one of my WordPress projects I have generated a podcast feed url through a plugin. When you look at the podcast feed url, there are a bunch of characters that seem to have been added to the end ...
2
votes
2answers
41 views

WP_User_Query order by meta_key that is an array

I have set a user metadata named achievements which is an array containing various numeric values. Using WP_User_Query, I want to order the list by a specific key within this array named points. The ...
-1
votes
0answers
8 views

Load a php file that contains an advance custom field gallery in a div without reload

I can't manage to load a php file that contains an advance custom field gallery in a div, without reload.. This is my php file <?php $images = get_field('gallery'); if ( $images ) : ?> ...
0
votes
0answers
9 views

jQuery - WooCommerce checkout radio button [on hold]

I would like to show different fields on my WooCommerce checkout, depending on the chosen shipping method. What I am looking for is a jQuery function that checks whether the radio button with id ...
0
votes
1answer
234 views

how i can hide some category from author admin panel?

i want author can not see some category from author admin panel but administrator can see that.how i can hide some category?my site http://techjagot.com .. here show some function.php code <?php ...
1
vote
3answers
597 views

Loop with slider (slider not loading)

In my slider.php I have a loop that calls for a custom post type. That custom post type has a meta box for a slide url (link/title/etc). I can see the loop and everything else is working because in ...
2
votes
1answer
231 views

Crop image from get_theme_mod Customizer field

I'm using the following code to allow a user to upload a custom image (in addition to header image) through the customizer. Is there a way to crop the image when displaying it? ...
0
votes
2answers
392 views

Simple seo-friendly custom $_GET url rewrite with htaccess

I have this url: http://sitename.com/?game=runescape Is it possible to modify the htaccess file or rewrite the url via Wordpress to become like this: http://sitename.com/game/runescape
0
votes
1answer
31 views

How To Make Connection To WordPress Data Base In A Plugin?

I am learning Plugins and I am trying to connect WordPress database wp-config.php in my Plugin PHP code. Currently for checking my code, I used the below connection and it is working fine. Now I ...
1
vote
2answers
29 views

How Can I Call Up The Author's Name on a Post

For some reason my by author disappeared and I cant turn it back on. I know where I want to put it on single.php at the end of the post, but I can't figure out what code I have to put in for it to ...
0
votes
1answer
2k views

Auto Gallery from folder contents

I need to be able if this is possible, (i am a newbie at this so please take that into consideration) I want to create a Wordpress shortcode that will add an automated gallery of the contents in a ...
0
votes
1answer
10 views

Show custom default avatar instead of gravatar

I'm using this custom function to get the default avatar from my server instead of gravatar: if(!function_exists('custom_avatar')){ function custom_avatar($avatar_defaults){ ...
-1
votes
0answers
14 views

wordpress and IONCUBE issue [on hold]

i am using a premium theme in WordPress 4.0. but problem is when i tried to change function.php file, it return error "encoded function.php file is corrupted." all data in function.php file is ...
0
votes
1answer
21 views

If is page, archive or search output this code

Hi there I'm trying to make this code works for more than just home page but I'm getting errors while trying to accomplish it... can someone help me? I'm trying to use this: <?php if ...
5
votes
1answer
1k views

How to make simply “report” button on posts

I'm building up a video-site using wordpress. It embeds videos from different sites. I really need a simply "Report broken video"-button that saves the url in a database or emails it to me. I've ...
0
votes
2answers
22 views

wordpress.org disallowing my plugin becuase of loading core files in cron cpanel file

I made a plugin and trying to install on wordpress.org but Wordpress is giving me error message that ## Calling core loading files directly is incorrect. I am using a cron file in my plugin.This cron ...
0
votes
0answers
17 views

“imagejpeg” function is not working in wordpress

$image = imagecreatefromjpeg('http://localhost/test/wp-content/uploads/2014/09/city_81.jpg'); // choose a color for the ellipse $ellipseColor = imagecolorallocate($image, 0, 0, 255); // draw the ...
0
votes
1answer
38 views

Shortcodes (with a space) added to php Sample

I have found only a small handful of posts from around the internet regarding Shortcodes and allowing them to work / execute within Admin Pages. So, I have made several admin pages in Wordpress, and ...
0
votes
3answers
474 views

How to store accumulate multiple option values in a single array using Options_API

I have created an option array that stores a series of options, along with their values. The problem is that I want to ACCUMULATE these options and store them in the options database. Meaning I would ...
0
votes
1answer
22 views

Using 'mysqli_connect' 'crashes' Wordpress client-side

I am using Wordpress as a CMS for a bus-route planner, I have inputted the first few bus stops for the first bus route and am now developing a PHP script for the planner. I am using this code, with a ...
0
votes
0answers
10 views

Getting Post Thumbnail from RSS feed with SimplePie

I am trying to pull the post thumbnail from an RSS feed to output on an external site. I am using the following function to add the post thumbnail to the site: function rss_post_thumbnail($content) { ...
0
votes
1answer
31 views

get image url inside the content in wordpress?

I want to get the image_url from the content.Actually i have done the following code to get the content: $content=$query_val->post_content; i'm getting following as o/p: "content":"Lorem ...
0
votes
1answer
27 views

apply_filters() function

I have used apply_filters() while retrieving the content from WordPress post like: $content=$query_val->post_content; $content = apply_filters( 'the_content', $content ); When I was using ...
-1
votes
1answer
17 views

How to add image/logo to this Wordpress theme? [closed]

So the Wordpress theme i'm using is Moesia. You can find a demo of it here- http://demo.athemes.com/moesia/ But the thing is they don't have an option to add an image on the first section (welcome ...
1
vote
2answers
321 views

Custom gallery in wp3.5

I used a tutorial I found for a slick little custom gallery in 3.4, but upon upgrade to 3.5 it no longer works. I'm trying to learn php still and can't seem to get this working again, as I either get ...
0
votes
0answers
19 views

Color Picker - Manipulate CSS

So i've been able to hook everything up to my theme options, the color picker now works and correctly manipulates certain piece of CSS, so that is all working. What i'm asking now is if there is a ...
0
votes
0answers
22 views

stuck in $args value insertion how to pass more than one value

I am in a middle of building a plugin and some how I manage to limit profiles to show only with the users with role regular_user by putting this line in my code $args['role']='regular_user'; ...
1
vote
1answer
32 views

Using shipped version of jquery

Thare are no errors in the JS console. My goal is to use the shipped version of jQuery that Wordpress uses to work with bxslider. According the link shown here, the current version of jquery shipped ...
1
vote
3answers
1k views

Extract the first oembed url inserted on the content of a post

I want to extract the first oEmbed url inserted on the content of a post in order to put in a meta tag from the header, or elsewhere as a way to style it differently from the rest of the content.
0
votes
1answer
24 views

How to define Og Meta Tags in header using conditions [duplicate]

I'm trying to configure my Facebook Og meta tags in my header so I get a different result on the type of page I want. I've been hitting some road block that searching through google haven't been able ...
-2
votes
0answers
34 views

How to prevent sql-injections for non-specialist in PHP [closed]

As I know sometimes some Themes or Plugins for WordPress can content "bad code" and probably site can be hacked via SQL injection. And I want ask If I change in wp-config.php file database prefix to ...
0
votes
0answers
43 views

Single Post with modal window

I read some threads here but i can't find the right answer. I'm using bootstrap, and i've this code inside of the archive.php: <div id="myModal1" class="modal fade" tabindex="-1"> <div ...
3
votes
1answer
3k views

Allow HTML in excerpt

Here is my excerpt code. // Generate custom excerpt length function wpbx_excerpt_length($length) { return 300; } add_filter('excerpt_length', 'wpbx_excerpt_length'); How do I allow html like ...
0
votes
0answers
23 views

$wpdb->get_results(…) returns empty array despite correct query

As title implies, I cannot seem to get $wpdb->get_results to give results. Running the "raw" query is successful, but this seems to be failing for some strange unknown reason. global $wpdb; ...
0
votes
1answer
32 views

php Code return blank page

I am testing some code for a local wordpress site and am editing the theme's functions.php file. As i was writing the below code, it just return a blank site. Anyone can enlighten me? i tried turning ...
0
votes
1answer
247 views

Random Category with Recent Post Title and Thumbnail

This code below works perfect to pull the title of five random categories, the issue is for each random category I want the latest post title and thumbnail but where and how do I add the post query? ...
0
votes
0answers
7 views

Validate email, if field has characters

I am building a small form on my website where I want users to be able to send me a message and have the option to include their email in an email input. It's fairly simple: ...
1
vote
1answer
823 views

How to get Poster (thumbnail) Image of Video

I'm getting all videos using the function below and it's working fine. Now I want to get the videos Poster Image (Thumbnail Image) from that video. How can I get the video Image as thumbnail? I've ...
-4
votes
0answers
14 views

How i can have the best optimization on wordpress [closed]

I need some help to optimize my blog, any sugestion or help. thi is my blog http://tecnologiageek.com/
0
votes
0answers
15 views

Woocommerce update cart total_discount after woocommerce_checkout_update_order_meta [closed]

I am applying discounts programatically during woocommerce_calculate_totals.I want to insert this discount_total into a custom table after woocommerce_order_status_completed.So I am updating this ...
0
votes
1answer
475 views

Issue displaying multiple TinyMCE editors with WPAlchemy

I have a custom post type with a WPAlchemy admin meta box class including multiple textareas with TinyMCE editors(for adding content to the custom post template). I've gotten the editors to display ...
0
votes
0answers
31 views

PHP switch and AJAX display WordPress post

I have a world map on a WordPress page. I'd like to load a particular post onto the page depending on what region of the map is clicked. I'm writing this as a plugin for my site. Here is what I have ...
0
votes
2answers
2k views

How to display child page from specific parent page in homepage?

How to display child page from specific parent page in homepage ? This is my page structure Home About Us Hotel Category Hotel A Room 1 Room 2 Hotel B Room 1 Room 2 Hotel C ...