A function is a sequence of program instructions that perform a specific task. It is packaged as a unit that can be used wherever the according task should be performed.

learn more… | top users | synonyms (2)

2
votes
2answers
254 views

Find first image on paginated post for Pinterest

I've been looking for days, yet can't find a good answer. Perhaps the SE crowd can be of assistance. Any help is much appreciated. I am using a custom-coded pinterest button included on posts that ...
1
vote
2answers
49 views

How would I add “edit profile” and “blog post” functions to front-end?

I'm rather new to Wordpress and I've been looking around for an hour and a bit but cannot find what I'm looking for. I want to add an "edit profile" button to the author page so the user can edit ...
1
vote
2answers
74 views

Child Theme files - what is needed?

On child themes: It is stated: ... create a file called style.css. This is the only file required to make a child theme. Then, it states: The correct method to import the parent themes ...
1
vote
2answers
116 views

Why does `url_to_postid` return 0 when testing `page_for_posts` Page?

If I set Reading Settings > Posts Page (in other words, the page_for_posts option) to a static page, and then attempt to pass its URL through url_to_postid() it will return 0 - why is it? I ...
1
vote
2answers
107 views

Get list of all custom tanonomy id

I created a custom taxonomy called Location then added New Jersey, New York, etc. Is there a Wordpress function that will get the list of all ids under the Location similar to what ...
1
vote
2answers
76 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 ...
1
vote
2answers
326 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 ...
1
vote
2answers
480 views

Using plugin functionality in external php script not working

I am encountering a strange problem which I couldn't solve so far. I'm calling a .php script via cronjob (Debian/GNU Linux). To use wordpress functionailty I added: define('WP_USE_THEMES', false); ...
1
vote
2answers
520 views

Update user meta of author when post content is viewed

I have a value that I'm trying to store as user meta for authors on my site. I need it to update itself every time the content of a post is viewed for that author. Here's as far as I've gotten but it ...
0
votes
2answers
34 views

Excerpt length: get 2 paragraphs

I have successfully implemented a solution from WPSE that trims the except to the first paragraph, but I'd like to change that to trim after the second paragraph instead. There's a link floating ...
0
votes
2answers
47 views

Retrieve post modified date for specific post by post ID

I am looking to use the 'the_modified_date' function to display the date and time of a specific post has been modified. This information will appear in the header of our website on every single page. ...
0
votes
2answers
75 views

Passing variable as add_shortcode argument

I'm trying to pass a variable into the add_shortcode function to be used as the shortcode name but it does not seem to be working. Is there a way that I can pass a variable similar to this? foreach ...
0
votes
2answers
62 views

How to arrange PHP files to allow for multiple types of pages

I am new to WordPress development (the most I've ever done on the web design/development side of things is creating basic HTML sites); so this may be an extremely simple question, but I am trying to ...
0
votes
2answers
124 views

WP Theme Development, Adding Content Areas to Custom Page Template

I am not sure how to ask this, which is why I have been having trouble finding anything via google searches. I am hoping someone here will understand what I am looking for and be able to direct me to ...
0
votes
2answers
55 views

Dynamic body classes based on current page

Is there a way to add classes to the body_class function based on the current page? For example if you're on the homepage, as well as the usual generated classes, the <body> element would also ...
0
votes
2answers
58 views

Wordpress - registering sidebar and adding a button directly after .textwidget

I have registered a new widget area, code as below and want to add a button after the .textwidget, however cannot seem to do it properly. Adding it after the </li> results in the button not ...
0
votes
2answers
38 views

Update functions.php from Wordpress dashboard

I'm sure this isn't possible but I thought I would ask. In my functions.php file I have a wp_mail function that sends an email to moderators when posts are made. This email is sent to number of ...
0
votes
2answers
148 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
2answers
123 views

User function to return multiple get_post_meta()

I am trying pass a WP function to a user function, where I can pass a new func argument $key for each post_meta type here: functions.php function my_post_meta($key){ $meta = ...
0
votes
2answers
43 views

Unregistering custom tinymce plugin?

I want to unregister a custom tinymce plugin in one of my child themes. The custom tinymce plugin uses basically: http://codex.wordpress.org/Plugin_API/Filter_Reference/mce_external_plugins excerpt: ...
0
votes
2answers
39 views

Wordpress plugin options need to delete after deactivate & uninstall

I have developed a wordpress plugin and I need to delete the options I am creating when uninstalling. What I did is I created a file called uninstall.php and included the following code: <?php ...
0
votes
2answers
86 views

How to use scripts when header/footer are stripped out

I'm working with a client who is wrapping the body of our WordPress site with their own external header and footer, stripping out our header and footer. Our enqueued plugin scripts then, aren't ...
0
votes
2answers
166 views

PageNav Not working on Custom Post - function built into theme

The Pagenav will not appear on this page, I've got the wp-pagenav function built into the theme so calling it works on all the other pages. It appears on the blog template I'm using but just not the ...
0
votes
2answers
3k views

redirect wp-login.php to another page

I would like to redirect this page wp-login.php to /login page. So when a user clicks on a link like this <a href="/wp-login.php">login</a>, wordpress will redirect him to /register . I ...
0
votes
2answers
158 views

Who To Create Option Page For This Simple Plugin

I know how to write WordPress plugins but I have no idea how we could create an option page for our plugin. I read lot of tutorials but I still have no idea about creating option pages. So just for ...
0
votes
2answers
183 views

Shortcode to find and replace URL

I'm trying to create a shortcode that will search within some specified text for a link and replace it with one that I specify. For example: [scode]Click on <a href="www.X.com">this ...
0
votes
2answers
50 views

Undo a function that is not (seemingly) hooked to an action?

I am using the popular Disqus plugin. To use this plugin effectively, they advise you to change the URL on the front page to end in #disqus_thread. I know how to easily do this in jQuery, but I ...
0
votes
2answers
393 views

How to add icon over specific thumb

I wanted to do the following, and I know its possible, but I don't know how. I'm looking at in_category, but it doesn't make to much sense. Basically what I want to do, for an example on my homepage, ...
0
votes
2answers
88 views

Why does modifying my functions.php file always result in a server error

Basically, every time I modify my functions.php file and reload it to the server my site "breaks" and nothing loads. As soon as I delete it, it starts working again. Now before anyone freaks out, I ...
0
votes
2answers
120 views

Getting rid of the blog page entirely

My goal is to not use a separate blog page but end up with a structure like this... http://domain.tld/page/comments/ I believe I can do this with the Cornerstone plugin ~ [ ...
0
votes
2answers
176 views

can not call functions in function.php

In front-page.php I have the following code: <span class="amountOnline"> Online: <?php echo $cbMain->GetInfo()['Players'] . '/' . $cbMain->GetInfo()['MaxPlayers']; ?> ...
0
votes
2answers
128 views

Show one post per author and order by custom field

I display one post per author with function below and works fine, but is possible order by custom field? <?php add_filter('posts_groupby', 'author_groupby'); function author_groupby($groupby) { ...
0
votes
2answers
153 views

Using locate-template & shortcodes doesn't appear to work

For organisation, I'm trying to split up the functions.php file into separate files. In particular the functions for shortcodes in a separate file, with the shortcodes being defined in functions.php. ...
0
votes
1answer
69 views

How to extend the page editor?

I'm really a newbie to WordPress. I can edit the page via admin Page menu. There is a form submitted on that page. How can I write my own functions to handle this form submission? In other words, how ...
-1
votes
1answer
19 views

Display function from functions.php in tag.php

I've added several functions to the functions.php file. I call those functions using a shortcode [shortCode] while in posts, pages, and widgets. But the [shortcode] will not work outside of posts, ...
-1
votes
1answer
962 views

How to Display Post View Count

I am trying to display post view counts. I've tried below function to display the post view count, but I'm getting same post view for all the post in loop. Not getting correct post view count. ...
-1
votes
1answer
499 views

Hueman layout styles and custom post type (DW Q&A)

I'm running a wp site with the Hueman Theme and the Q&A plugin from DW. The theme doesn't really plays well with the theme, so I had to find some solution for it. Managing the is somewhat painful ...
-1
votes
1answer
72 views

reusing code in function and running it with loop

In variable.php , the page use to display any attributes related to a product. I want some changes in code but not for all pages, so i think only point it to create a function of variable.php, and ...
-1
votes
1answer
89 views

Display Video as Post Thumbnail

I use the Nova free theme, from the Theme in Progress studio. I would like to display a video like a thumbnail image, as shown in this theme http://themeinprogress.com/demo/sueva/ How can I do this? ...
-1
votes
1answer
210 views

How to hook wp_mail to add a custom email as BCC for each sent email?

Is there a way to hook into the wp_mail function to add a custom email as hidden (BCC) copy to each email sent? If so, how? -edit- It's not like I want to send an email with BCC, I would like to ...
-1
votes
1answer
37 views

add if statement to the featured image

I have a featured image. I want to add an if statement to the size. For example, if the featured image height exceeds 500px I want to add something. Is that possible ?
-1
votes
1answer
34 views

Directing to functions.php the correct way

Right now I'm validating a form on one page, and then sending the results to functions.php to send the form via email. Right now I'm doing the following <?php $our_url = ...
-1
votes
1answer
555 views

Call to undefined add_action() in theme's functions.php

Once done validating a form with ajax, I use php within my functions.php to actually send the form. <?php $name = $_POST['fname']; $lname = $_POST['lname']; $subject_line = $_POST['subject']; ...
-1
votes
1answer
55 views

Using Schema with `the_excerpt`

I'm currently developing a WordPress site and want to use Schema, I have been some what successful so far but have now hit a stone wall. I want to use: itemprop="description" to the ...
-1
votes
1answer
180 views

Convert all uploaded PNG files to PNG-8 format

Running a high trafficed platform. In my quest to minimise bandwidth costs, I added a high JPEG compression on all JPEG uploads (check solution in my previous question). However, Wordpress does not ...
-1
votes
1answer
247 views

Replace & with &amp;

I have a plugin that unfortunately I have no control over, the problem I am experiencing is that it doesn't use &amp; in place of & and so breaks the sites validation. Is there a function I ...
-1
votes
1answer
177 views

Correct phph syntax to add an image in wp functions.php

as i am a newb here, please help me to get this solved. i am trying to add a function in wordprress functions.php where i am trying to display an image relevant to my theme folder here is my code ...
-2
votes
1answer
58 views

Get my site session in wordpress?

I am using a custom site build in zend frameword, i also have a wordpress installed in this directory, for example: www.mywordpressSite.com // here is my wordpress site.. ...
-2
votes
1answer
38 views

Save output of the_content_rss into variable

How can I save the output of the function the_content_rss into a string variable?
-2
votes
1answer
978 views

Adding a new layout for genesis

I have added a new layout for the genesis framework called "modalwindow". This layout should only display the content because it is a modal window loading page content (I don't want any of the header, ...