Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all 8245 articles
Browse latest View live

outmane on "jQuery code not working in Wordpress, even after loading library"

$
0
0

Helo everyone!
I have requested an API from a website to check availability of an email, and I got a jQuery code to integrate the API to my website. I use wordpress, and I tried to add the code, but it doesn't work and I dont know why. I suspected it was a jQuery library probleme, so I loaded it it in the "funtion" file, and in the script from google API, but nothing. Thanks for your help, and here is the code (by the way I also tried changing with 'jQuery.'):

<!DOCTYPE html>

    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head>
            <meta charset="utf-8" />
            <title>emailverifyapi.com : License Key Sample.</title>
            <style type="text/css">
                    .statusUnknown {
                            color: #c1c72c;
                    }

                    .statusOk {
                            color: #009933;
                    }

                    .statusBad, .errorMsg {
                            color: #ff0000;
                    }

                    input[type='text'] {
                            width: 300px;
                    }
                    p label {
                            display: inline-block; width: 60px;
                    }
            </style>
            <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    </head>
    <body>
            <h1>emailverifyapi.com : email verification demo using simple key authentication with jQuery.</h1>
            <h2>About</h2>
            <p>This example shows how to perform email verification using just client side scripting and invoking a simple key based RESTful endpoint at <a href="https://api.emailverifyapi.com" target="_blank">api.emailverifyapi.com</a>.</p>
            <h2>How to run this sample</h2>
            <p>This page can be hosted anywhere (i.e. any web host or platform). The only thing needed is a valid license key.</p>
            <h2>Key features</h2>
            <ul>
                    <li>Compatible with all modern browsers</li>
                    <li>Uses jQuery 1.11.1</li>
                    <li>No server side scripting required</li>
            </ul>
            <hr />
            <h2>Try it</h2>
            <p>
                    <label for="key">Key:</label>
                    <input type="text" id="key" name="key" tabindex="1" maxlength="20" />
            </p>
            <p>
                    <label for="email">Email:</label>
                    <input type="text" name="email" id="email" tabindex="2" />
                    <input type="button" name="submit" id="submit" tabindex="3" value="verify" />
            </p>
            <div id="validationResult"></div> <!--Result output here-->
            <script>
                            /*nest key logic inside document.ready to ensure functionality only available once document has fully loaded in browser.*/
                            $(function () {
                                    console.log("ready!");

                                    $('#submit').click(function () {
                                            var emailText = $('#email').val(); // get key from text box entry
                                            var keyText = $('#key').val(); // get email address to be checked from text box

                                            if (keyText.length == 0) {
                                                    $('#validationResult').html("<span class='errorMsg'>Please enter key.</span>");
                                                    return;
                                            }

                                            if (emailText.length == 0) {
                                                    $('#validationResult').html("<span class='errorMsg'>Please enter something for email.</span>");
                                                    return;
                                            }

                                            $('#validationResult').html("verifying...");

                                            var emailVerifyApi = '//api.emailverifyapi.com/api/a/v1?email=' + encodeURIComponent(emailText) + '&key=' + keyText;

                                            /*execute remote request to perform email verification. Any errors will appear in the developer console (e.g. viewable using Chrome developer tools)*/
                                            $.getJSON(emailVerifyApi, {})
                                                    .done(function (data) {
                                                            reportResult(data);
                                                    })
                                                    .fail(function (jqxhr, textStatus, error) {
                                                            var err = textStatus + ", " + error;
                                                            console.log("Request failed: " + err);
                                                    });;
                                    });
                            });

                            /*Output result to the 'validationResult' div element*/
                            function reportResult(data) {
                                    var status = data['status'].toLowerCase(); // get 'status' from REST response
                                    var additionalStatus = data['additionalStatus']; // get 'additionalStatus' from REST response
                                    var message = data['Message']; // if there is an error (e.g. license issues), a notification will appear in the 'Message" from REST response.

                                    console.log(status);
                                    console.log(additionalStatus);
                                    console.log(message);

                                    var statusHtml;

                                    // if there is an error message, show here
                                    if (message != null
                                            && message != '') {
                                            statusHtml = "<span class='errorMsg'>Error. Message='" + message + "' .</span>";
                                    } else {
                                            // map REST response data to presentation messages.
                                            switch (status) {
                                                    case 'ok':
                                                            statusHtml = "<span class='statusOk'>Email address is ok.</span>";
                                                            break;
                                                    case 'bad':
                                                            statusHtml = "<span class='statusBad'>Email address is not valid.</span>";
                                                            break;
                                                    default:
                                                            statusHtml = "<span class='statusUnknown'>Unable to validate email. Reason=" + additionalStatus + "</span>";
                                                            break;
                                            }
                                    }

                                    console.log(statusHtml);

                                    // present the result on screen
                                    $('#validationResult').html(statusHtml);
                            }
            </script>
    </body>
    </html>

braedenklassen on "Editing code to replace text with a photo?"

$
0
0

Hi, I know very, very little about coding so I've been trying to avoid it, but I don't think I can if I want to do this. Is it possible to go into the Editor and change the code to allow a logo (photo) instead of a site title (text) in a Theme Options Slider? The theme I'm working with is called "Ample". The link to the site I'm working on is...

http://captureworks.ca/wp/

...I want to replace "Capture Works" with a logo. Theme Options allows me to enter a title for the slide but not upload a photo.

Where in the Editor would I have to change code? What would I add/replace? Any help is greatly appreciated :)

mattswett on "Gravity forms"

$
0
0

Hey all,
Trying to get some help - I am trying to use gravity forms and woocommerce together to create a reactive menu for a bicycle company I work for. Basically what I am trying to do is have an image displayed once the user selects a modification from the drop down menu. If anyone has some help to offer I'd really appreciate it, I found a bit of code here:
https://www.gravityhelp.com/forums/topic/linking-images-to-certain-drop-down-fields
But I dont understand how to insert the code they provide in step 3

"Third, add the code above to your theme's javascript file or header. Make sure jQuery is being loaded on this page."

As the article is over three years old - is there an easier way to do this now and/or does anyone know of a plugin that might help me out?

harrypurnama on "Add page name to URL"

$
0
0

Hi, how can I get page name in the URL.
Example:
I created a page named "Article", and this name became a Menu.
In that page/menu, there are multiple article.
My questions is, how can I get the URL like this: wwww.domain.com/article/post-name ?

For now, I always ended up get http://www.domain.com/post-name.

How do I change that? And which file should I edit? Fyi, I install in localhost, and I want create a website about news.

Thank you.

chicagodave on ""Add a Comment"/"Comments: ##" from WordPress.Com"

$
0
0

I would like the functionality that exists in WordPress.Com for the comments link at the bottom of an article in an RSS feed.

I see this in two different blogs and it is not theme related. It has to be in the core WP code base.

Examples:
https://emshort.wordpress.com/feed/
https://heterogenoustasks.wordpress.com/feed/

In both cases, a comments link is appended to the article in the RSS feed. This link does not exist in the article itself.

The pattern is (from the second blog feed):

<a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/heterogenoustasks.wordpress.com/1943/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/heterogenoustasks.wordpress.com/1943/" /></a> <img alt="" border="0" src="https://pixel.wp.com/b.gif?host=heterogenoustasks.wordpress.com&blog=63930094&post=1943&subd=heterogenoustasks&ref=&feed=1" width="1" height="1" />

The image is a favicon from feeds.wordpress.com that shows either "Add a Comment" (as an image) or "Comments: ##" (also as an image) and the link takes you to the blog comments section directly.

I'm guessing this is a hack in the feeds-rss2.php code, but am unsure what to put there to achieve the same results.

Note that I've asked the WordPress.Com folks for help and they sent me here, so please don't send me back there. (:

David

galeroy on "default-constants.php WP_MEMORY LIMIT over-written when WordPress updates"

$
0
0

I increased my WP_MEMORY LIMIT to 96M in default-constants.php

The problem is that whenever a new version of WordPress is installed, the default-constants.php file is replaced with a new file and WP_MEMORY LIMIT reverts to the default value of 40M.

Does anyone know how to modify WP_MEMORY LIMIT so that it 'sticks' and doesn't get over-written whenever a new version of WordPress is installed?

pigsound on "a-z index plugin with multi-column names list for search query"

$
0
0

i am looking for a way to solve the following problem:
first, you should see the letters of the alphabet listed horizontally. on clicking on one of the letters, a multiple column window should open below and contain a list of names beginning with the chosen letter. the names should also be klickable and should produce a search results list below the window with all the posts containing that klicked name (preferably without reloading the page).

how could this be done?
thanks for your help!

kangoo1313 on "Taxonomies and Custom Post Types differences"

$
0
0

Hello,

I would like to know if this is possible with the hierarchy :

Nations ( Taxonomy) -> Competitions ( Taxonomy ) , Seasons ( Taxonomy ) -> Clubs (Custom Post Type) -> Player ( CPT ), Staff (CPT)

My main question is, is that possible that the competitions and seasons can be hierarchically with the nation which is a taxonomy too ?


DNSOCCU on "[Collection and delivery date plugin]"

$
0
0

Hello everyone,
I'm creating a website for laundry & dry cleaning.
it's been a long time that i'm searching for a plugin wich can make my website clients choose a collection and delivery date for their clothes,i found some plugins but they can just allow clients to choose deivery date, can you help me please

joelharkes on "How to go from a git repo to svn. (update scripts)"

$
0
0

Here is my story. I was happily developing my wordpress plugin, and saving it in bitbucket until I decided to let wordpress host my plugin (easy updates, how awesome?!). But i wanted to keep using git, because it is just way better. So I needed deployment script. I did some scripting and here is mine, you can use it for yourself.

I added and saved mine in my svn main folder (otherwise this script doesn't work). it is based on powershell which their for windows. you might need to execute this command first: "Set-ExecutionPolic unrestricted". to be able to run powershell scripts.

here it is (I called this file Update.ps1):

echo "SVN UPDATE SCRIPT"

$gitFolder = "C:\Path\To\Your\Plugin"
$svnUrl = "http://plugins.svn.wordpress.org/[svn-plugin-name]"
$version = Read-Host 'Do you want to update version? Type version number (if not leave empty)'

$message = Read-Host 'Commit message'
if (-Not $message){
    $message = "A Powershell Commit message"
}

Remove-Item trunk\* -recurse

echo "Copying files"

Copy-Item "$gitFolder\*" trunk\ -Recurse
#Remove-Item trunk\.git -Recurse
Remove-Item .\trunk\.idea -Recurse
get-childitem .gitignore -recurse | remove-item

echo "Setting up svn for commit"
#Delete missing files
svn status | ? { $_ -match '^!\s+(.*)' } | % { svn rm $Matches[1] }

#Added new files
svn status | ? { $_ -match '^\?\s+(.*)' } | % { svn add $Matches[1] }

echo "Commiting to svn"
svn commit -m $message

if($version){
    echo "Updateing to Verion $version"
    svn copy "$svnUrl/trunk" "$svnUrl/tags/$version" -m "$message. updated to version $version"
}

Mbertu on "Saving option for the first time"

$
0
0

Hi everybody, I'm Michele from Italy. I've a question about the saving option's process.
Both in my plugin and my template I've found a problem. The first time an option is saved the validation callback passed to the register_setting funciton is triggered twice.
First time the input variable have the post fields values, the second time have the output of the first callback execution.
Is this normal?

pawawat on "How could I add button next to "edit image" button in "Attachment Details""

PuNK DeSi on "Include posts from all child categories on parent page."

$
0
0

Suppose I have categories structure Like:

FRUITS
|----APPLES
|----GRAPES
|----MANGO
|----BANANA
|----PINEAPPLE

when i post something in "Apples" category its available only while visiting that category. But no post is shown in 'FRUITS' section.

For that i have to add two categories for each post "FRUITS, APPLES". It is very difficult to edit thousands of old posts & add two categories.

I am looking for some function or hack so while visiting parent category, automatically display posts from its all child categories.

caroline on "Change URL on attachments (image.php)"

$
0
0

I use the latest version and Twenty Fifteen (latest parent) and child.

I would like to have the attachments URL changed and can't find a good tutorial of how to do it. Is it possible?

More specific, I don't want the attachments ID in the URL, I want the attachments title (a seo-friendly) one.

Kindly asking,
Caroline

lada2015 on "Remove Read more buttom"

$
0
0

Hello everybody

Do you know how can i remove the Read more button in the category list.
I use graphene theme.
I want to display just the main picture and the title of the posts of the category i have selected in the main menu. Then just clicking on one of these to access to the post, without a Read more buttom.

Thanks in advance


king-a-s on "Duplicate default Comments system"

$
0
0

I need a code (plugin) to duplicate default comments system and use it with CPT
and duplicate all settings and modified it

anyone can help me?

thanks

Loc Pham on "Unavailability of forum queries using XML-RPC"

$
0
0

I'm developing an iphone app and looking for ways to display on my app the forum posts that users engage on my wordpress website. However, I don't see any information from codex reference guide on how this can be achieved (if possible). From this Codex guide, I can query posts, pages, comments...etc. Since, my wordpress site is using AnsPress & bbPress to host the forum discussion, is it possible to use XML-RPC (or REST) to get the data from AnsPress & bbPress?

Any suggestion to move forward would be greatly appreciated.
Thanks

dgcov on "plugins_url not returning the plugin url"

MicahRicah on "Two folders suddenly appeared on all my websites"

$
0
0

Hi all.
Suddenly I noticed that all of my WP websites got a two folders in the root directory (next to wp-admin, wp-content,wp-includes). These folders are flagallery-skins and plugins.
I have wordfence and sucuri running and they show no infections but I am concerned why is this happening. I have noticed that directory ..\29 Aug 2015\flagallery-skins\themes\uploads\quick-setup\components\acismittop96\ has many sports brands folder names and they are filled with .html files.
I also noticed that site does not break when I delete these directories. Does anyone else have a similar experience and how should I approach this since I did all the steps from "what to do when my site is hacked" codex?

js_webb365 on "How do I use a post(Custom post-type) as front page?"

Viewing all 8245 articles
Browse latest View live




Latest Images