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)

0
votes
0answers
26 views

How to get new posts via Ajax when using Waypoint.js

So I have an ajax call in one of my pages when you hit a certain waypoint within the dom. I then call a Wordpress function that I have created. The function is working in that it gets the first posts, ...
0
votes
0answers
12 views

Gallery Meta box not showing on single post

I want t replicate a Tour module into restaurant, not much gud in development so have created a Custom Post Type "Restaurant". It has same features as "tour" have but i get stuck when a Gallery meta ...
0
votes
0answers
47 views

Block user redirection to wp-login.php on leaving password blank in frontend login

When a user leaves the Username / Password / Both Blank and clicks login in frontend buddypress login, he is being redirected to wordpress admin login url stating wrong username/password/empty ...
0
votes
0answers
23 views

Auto expire page that contains specific text

Sorry, I'm relatively new to Wordpress. Is there a function or script that can automatically expire a page that contains specific text? I am using an RSS feed to display some content on a page (not ...
0
votes
0answers
18 views

How to a override parent theme page that has been included with require_once?

I need to override a parent theme file which is added in function.php like this: if (class_exists('Woocommerce')) { require_once( get_template_directory() . '/woocommerce/config.php'); } A template ...
0
votes
0answers
16 views

auto metakey value on post tile

I have this metakey "word_srch" the metakey has no value, i have to input the value in the custom field in the backed, instead, how can i create a function code that will automatically input the value ...
0
votes
0answers
16 views

Transfer custom post nav (prev/next) from one to another theme

I bought two themes and just want to assume a special next/prev post navigation from the first theme in the second theme. I've searched the theme files and found the function, which declares this ...
0
votes
0answers
19 views

Plugin - overwritting entire non-pluggable function

In order to achieve what I want to do with my plugin I need to modify several functions inside comment.php and comment-template.php ( for instance some code lines like if ( is_user_logged_in() ) : ) ...
0
votes
0answers
20 views

get_pages() shows either ALL pages or just main-menu

I'm losing the battle with get_pages(). What I'd like is a list of child pages to display on each main-menu parent page. I'm trying get_pages() rather than wp_list_pages() as I'd like to be able to ...
0
votes
0answers
20 views

Echo multiple tasks if a common function exists

How can I echo multiple tasks if a common WordPress function exists. For example, I want to reduce the following: <?php if (function_exists ('pluginName')) echo someName (1); ?> <?php if (...
0
votes
0answers
46 views

Add post order to function

How to add post order to this function? I would like to display most recent post from newest to oldest: <?php //Establish first post check variable $first_post = true; query_posts('category_name=...
0
votes
0answers
11 views

Category specific attribute

I wonder what is the best way to define specific attribute for category. My idea is following. I have some categories that are just wrappers, they don't contain any post so they are only parent ...
0
votes
0answers
23 views

function to write the output of a variable + post_title in post_content

I have a function that writes the output of a function of a rand_keys + the post_title in post_content, but writing the title but only happens after I click manually on the update button on the post-...
0
votes
0answers
27 views

How to Publish a Post Multiple Scheduled Time

I want to publish a post in WP, but not immediately. So what I am doing is like this- From this tutorial. So, I am getting only 1 time when the post will be published. But I want to the post be ...
0
votes
0answers
27 views

Display most popular posts

I have already found a way to display recent posts: <?php $args = array( 'post_status' => 'publish', 'numberposts' => '60', ...
0
votes
0answers
24 views

Update custom fields after updating related custom field

I have a custom post type that I'm filtering by a custom field, I then select one of these posts & update it in the front end. But when this is updated, I need to also update the other filtered ...
0
votes
0answers
23 views

Removing commercial theme's custom autop on specific pages via functions.php

So my problem is with using the custom theme Karma at http://themeforest.net/item/karma-responsive-wordpress-theme/full_screen_preview/168737 Great theme.. except it removes the default wpautop/...
0
votes
0answers
47 views

taxonomy child term url change

Currently I have custom taxonomy called "client_categories" under custom post type "press_centre" I want to change url from www.mysite.com/clients/client1/image_library_1/ to www.mysite.com/clients/...
0
votes
0answers
19 views

Help removing post images older than X days

I need to remove images in posts older than a set amount of days. I feel like my code should work but it does not and I do not know why it doesn't. My website, when this is added in functions, ...
0
votes
0answers
23 views

Unhook (or remove) Sidekick Customizer Option using a function

How do I remove / disable / hide the "Click for Help" Sidekick Drawer? I'm reading over the codex and I just don't see anything relevent between this and the plugin. I downloaded the plugin, start ...
0
votes
0answers
28 views

I want to add values ​of a function in all posts in a particular category

I want to add values ​​of a function in all posts in a particular category, I get exactly what I want, but not the old problem appears in post_content(edit mode em dashboard) add_filter('the_content',...
0
votes
0answers
32 views

Sanitization Function in Wordpress (Example Twentyfifteen.1.4 Default WP Theme)

The ThemeForest Submission Requires some sanitization functions that should be incorporated in the theme - This page says this. The WordPress theme should make use of the following inbuilt ...
0
votes
0answers
26 views

How do link to the most recent post in a category (Cornerstone theme)?

Hello friends :) I am in a pickle. I am creating a website in X/Cornerstone for an artist who has many projects , each has of which has its own Wordpress site. All of them rely on blog posts to ...
0
votes
0answers
34 views

Subcategory generated based on title of custom post type

This is what I have in my functions to create a category based on the title of a custom post type "attorneys": add_action('save_post', 'add_title_as_category'); function add_title_as_category( $...
0
votes
0answers
16 views

How to load comments based on URL parameter(s), not post ID?

I've modified my wordpress install to grab data from an external db instead of relying on the post system. The problem is, the same comments are loaded regardless of the URL - of course this is to be ...
0
votes
0answers
45 views

Limiting Wordpress search to category description

I'm working on a project where i need to customize the Wordpress search engine. I want to be able to search the category description in the 'wp_term_taxonomy' table. There are quite some snippets ...
0
votes
0answers
32 views

How can create pagination for specific category posts?

I'm trying to create pagination for specific category post in custom template, i create a function which is returning the all post pagination. I have overall 39 posts which are for different ...
0
votes
0answers
35 views

I would like to write the output of a function in normal post.php fields

I have this function, and it prints, displays these values ​​directly in the published posts: function gen_num() { global $post; $mixnames = get_post_meta( $post->ID, 'fieldnames', true ); ...
0
votes
0answers
75 views

Woocommerce subscription hook after renewal

I have a web store where users can purchase subscriptions (1 month, 6 months, 1 year). My store uses Woocommerce Subscriptions v2.0.8. What I want to achieve is when a subscription is renewed, I want ...
0
votes
0answers
104 views

Force update all posts in custom post type, no content changes

I have imported data from a custom post type that has location data for a map plugin (Progress Map). I have about 500+ posts each with different location data. For some reason the location data isn't ...
0
votes
0answers
55 views

Remove html content from Auto-Generated Excerpt

I've a website that syndicates content, and each article gets prepended with html content similar to "From Source A:" Wordpress obviously strips the html from that content when auto generating the ...
0
votes
0answers
45 views

Help needed with Wordpress Function/Loop please

I mostly come from a Front End/Design background and have built a few sites in Genesis/Wordpress but I am now delving into the world of making Custom Posts and pages through using a variety of ...
0
votes
0answers
37 views

Featured image in custom post is being disabled

I'm trying to create a custom post as a plugin and so far I'm having some trouble trying to enable featured image on my custom post type. Right now I have created two custom post types but the problem ...
0
votes
0answers
36 views

Override Class in Child Theme

I'm trying to customize a theme using Child Theme but I can't find a way to override this class, anyone can help me ? I've tried if ( ! class_exists('Extra_Page_Post_Settings_Meta_Box extends') { // ...
0
votes
0answers
21 views

Wordpress Costums Field Comment Box on Admin Page (Post Editing)

can help me about wordpress comment field on post editing in admin page? i want to change the default form like picture above : to like this...
0
votes
0answers
47 views

How do I output the returned value of a function that uses an earlier hook?

If I define a function that retrieves a value within an action hook and returns it, what is the best way to call the function in a later hook? My general aim is to write reusable functions with ...
0
votes
0answers
98 views

Change MySQL PDO connection to a WPDB connection

I have an autofill search box with a PHP script that gets data from the DB. It uses a PDO connection, and it works perfectly even with my WordPress Database, but since I'm not sure of how PDO works, I'...
0
votes
0answers
19 views

Getting autoset_featured image to jive with Facebook SDK

I'm trying to set up the Facebook SDK on a site where I'm auto-fetching the first image in the article to become the "featured-image". I would like that auto-fetched image to also be the og:image, but ...
0
votes
0answers
25 views

MPT Usage with NewsPaper WordPress Theme

I am using Multiple Post Thumbnail Plugin with NewsPaper WordPress theme Plugin Documentation: https://github.com/voceconnect/multi-post-thumbnails/wiki/Frequently-Asked-Questions Hello, I used ...
0
votes
0answers
62 views

Call to undefined function language_attributes(), add_action(), wp_header() and wp_footer()

Using a new theme for a Wordpress website I found yesterday in my error report that: Call to undefined function language_attributes() in header.php Call to undefined function add_action() in ...
0
votes
0answers
53 views

List authors by first letter with letter per page

Currently I have this working with first letter of post title with letter per page. <div class="alpha_navigation"> <div class="inner_alpha_navigation"> <?php foreach ($letters as $...
0
votes
0answers
43 views

Embed handler in custom field

I am trying to implement wordpress function wp_embed_register_handler() into a custom field. Using this instead of wp_oembed_add_provider(), for the urls I use do not offer oembed support. With help, ...
0
votes
0answers
28 views

Override a __construct function in child theme

I'm trying to override a loop function in a child theme. I've tried a lot of things I found on google, but something fails, sometimes nothing change, sometimes I get a 500 error. This is the original ...
0
votes
0answers
19 views

How do I redefine wm_navigation() or wp_logo() within a theme that uses hooks?

What I want to do: Move the title of my website from it's current location to be in the "menu" div so that it is to the left of the menu/page list. Demo page: http://aaronmoore.me/visartsassignments/ ...
0
votes
0answers
25 views

Add extra attributes to images via editor

Would like to allow editors to add: data-action="zoom" to image tag without them having to code it. Preferably from a TinyMCE button/menu. Example: <img class="alignnone wp-image-2438" src="...
0
votes
0answers
38 views

How can I make a function as sticky expired date post?

I want to edit functions.php to make a sticky post, the flow is post a post, clock will start and after 1 hours, the post will be disappear. Anyone can help me? Please. I have tried, I am really new ...
0
votes
0answers
26 views

add post type support not showing edit author options for all users

Need to allow all users (admins) to be able to edit the authors of a post. Added this to my wp-admin.php in the inc/functions folder but is hasn't worked: add_action( 'init', '...
0
votes
0answers
40 views

Removing A Parent Theme Template

There is a template with code that I want to prevent the child theme from loading. All it does is load a little date box. What i've done is duplicate the hierarchy of that template file located in the ...
0
votes
0answers
35 views

wp_verify_nonce() didn't work in the function

I'm creating link with wp_nonce in GET parameter: $link = esc_url( wp_nonce_url( add_query_arg( 'my_arg', 1 ) , 'product_subscription' ) ); echo '<a href="'. $link .'">'. $link .'</a>'; ...
0
votes
0answers
23 views

Everytime I press Save Settings from a Plugin it redirects to All Settings page

I have developed a settings page for a theme in which I'm working in order to have some options to customize it. Here are all the options and here is the functions.php. I don't know why but when I'm ...