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

elshan75 on "stock cod"

$
0
0

in woocommerce : in want show stokck for a produtc.
the php code what is it?


erikstainsby on "class-http.php not permitting self-signed SSL to work"

$
0
0

Ever since upgrading to the current version my debug.log is choking on these error messages and my AJAX callbacks are dying unanswered:

[30-Nov-2013 18:59:26 UTC] PHP Warning:  stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /usr/share/wp3.7.1/wp-includes/class-http.php on line 787
[30-Nov-2013 18:59:26 UTC] PHP Warning:  stream_socket_client(): Failed to enable crypto in /usr/share/wp3.7.1/wp-includes/class-http.php on line 787
[30-Nov-2013 18:59:26 UTC] PHP Warning:  stream_socket_client(): unable to connect to ssl://bcla.dev:443 (Unknown error) in /usr/share/wp3.7.1/wp-includes/class-http.php on line 787

Can anyone tell me exactly where I need to set the ssl_verify_peer = false ? Or someway I can force through the allow_self_signed_certs ?
My development work is dead in the water without this...

PGrizz on "Adding a custom field in addition to Post Name to Permalinks?"

$
0
0

By default WordPress takes the page title you enter in the editor and makes it into a permalink. This title is usually also the h1 of the post.

If I keep the default title in the editor as my h1, but then add another h2 that's added by an Advanced Custom Field, how would I be able to combine the custom h2 field into my page's permalink to help my SEO?

For Example: My post's title would be "WordPress Title" and my custom h2 field added to the post would be "Example for Forum" so the url would end up being "site.com/wordpress-title-example-for-forum"

Doesn't seem like it's as easy as just appending the custom field on to the end of /%postname%/ in the Custom Structure of the Permalink settings.

ppahppp on "thumbnail url from original image url"

$
0
0

hi guys and girls
i need to get to the url of the thumbnail using the url of the original image. this is basically so when users attach a large image with an image uploader/selector it pops up.
I was hoping not to have to reload the page as the image selector dosn't.
but that wouldnt cause too much issue and the image isnt the featured image.

studiofive on "What's in MySQL"

$
0
0

As a relative newbie to WP (and currently the victim of a hacker) I just need to understand what's stored in the MySQL dbase. My website is just static pages (no blog) and I wanted to know if all the information regarding what I have built is in the database. I am having trouble undoing what the hacker has done and was considering that if I have a dbase backup, can I go to Cpanel, delete WP from the server, reload a fresh version and then re-install the dbase and have the site restored to what it was (hoping that the hacker has not accessed the dbase).

TIEro on "Action on attachment upload not detecting mime type"

$
0
0

I'm writing a function for a plugin that does a particular action when a new media file is uploaded, provided it is of particular types (specifically docx and doc, i.e. MSWord documents). However, it doesn't seem to detect the attachment type correctly.

I suspect this may be because the action hook (add_attachment) runs before the line is fully created in the posts table, and therefore the mime type is blank. That said, the attachment_id is available, so shouldn't the mime type be there as well?

When I upload a docx, a doc and an image, all three are processed by the function and I get three lines in my documents table... there should only be two.

The action hook is simply:

add_action('add_attachment', 'wle_record_document_upload');

The function looks like this (it adds a line to a custom table which I will be using as part of the plugin):

function wle_record_document_upload($attachment_id) {
	global $wpdb;
	$user_ID = get_current_user_id();
	$type = get_post_mime_type($attachment_id);

	if ($type = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' || $type = 'application/msword') {
		$sql = "INSERT INTO {$wpdb->prefix}wle_documents (user_id, attachment_id, status_date)
				VALUES ($user_ID, $attachment_id, NOW())";
		$result = $wpdb->query($sql);
	}
}

If anyone can see what's wrong, I'd appreciate it!

orion_pt on "query inside post - same arguments produces different request according to view"

$
0
0

I'm trying to get the image associated with a post's taxonomy, the following query works well when in taxonomy's view but it produces a different request when used in category view. Can anyone give me some help here? I'm not very familiar with wordpress...

$myquery = new WP_Query();
$myargs = array('post_type' => 'attachment','post_status' => 'inherit','posts_per_page'=> -1,'tax_query' => array(array('taxonomy' => 'autor-convidado', 'field' => 'id', 'terms' => $term_id )));
$myquery -> query($myargs);

request on taxonomy view:
SELECT wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) LEFT JOIN wp_posts AS p2 ON (wp_posts.post_parent = p2.ID) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (485) ) AND wp_posts.post_type = 'attachment' AND ((wp_posts.post_status = 'inherit') OR (wp_posts.post_status = 'inherit' AND (p2.post_status = 'inherit'))) GROUP BY wp_posts.ID ORDER BY wp_posts.menu_order, wp_posts.post_date DESC;

request on category view:
SELECT wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (485) ) AND wp_posts.post_type IN ('post', 'nav_menu_item', 'produto', 'especialistas') AND (wp_posts.post_status = 'inherit') GROUP BY wp_posts.ID ORDER BY wp_posts.menu_order, wp_posts.post_date DESC;

andydraysen on "how to query mysql for newest posts"

$
0
0

What columns in wp_posts do I use to determine what a new post is?

I need to get title of the newest post.


kiddigeir on "Facebook plugin width on drop/pop down"

$
0
0

Hello Wordpress world!

I can't seem to find out how to edit the width of the Facebook "LIKE" plugin.

It appears on the bottom of every post/entry. When user is logged in on Facebook and he presses the button a dropdown appears, where he can write and post the article.

This dropdown seems to be only as wide as the actual button it self, cutting of most of the content in that small window making it useless.

Any suggestions on fixing that problem?

I went into the plug in on the wordpress dashboard and edited the width of the button (was none) and still the same.

Screenshot of the problem: <img src='http://s25.postimg.org/7rui3vny7/Picture_4.png' border='0' alt="Picture 4" />http://s25.postimg.org/7rui3vny7/Picture_4.png

qdungeng on "get post from slect field ACF"

$
0
0

Dear friend

I did install ACF (advanced Custom fields) and Create Select Field "Hotel_in", and more choices :
SG : Saigon
HN : Hanoi
HC : Hue City

...

Please help me how to get all post title and URL from single field and get label from single choices .

I did use :

if(get_field('hotel_in') == "HG")
{
//...
}

But it not working. Please help me.
Thanks

george@piccexcellence.com on "Return to Previous Page from Shopping Cart"

$
0
0

I am having a problem getting back to the correct page once I "view cart". We use the Zen shopping cart. I have tried setting Session variables and also setting a returnPage cookie. In each case the page id is incremented and I am returned to the wrong page. Seems like Zen really screws around with SESSION variables so I can't get them back the way they were set to start with.

Setting a cookie:

$dateToExpire = time() + 720;

	$page_id     = get_queried_object_id();
	$return_page =  "http://www.myserver.com/?p=" . $page_id;

	setcookie("ReturnPage", $return_page,$dateToExpire, "/", "myserver.com");

This is executed each time a page that contains a purchasable item is accessed so I can grab the page id, slap it in a cookie and retrieve it later when coming back from the shopping cart. My problem is $page_id keeps getting incremented between returning from the shopping cart and recovering the COOKIE value.

any thoughts would be appreciated.

G.

drizzt99 on "global $post and get_post() aren't working"

$
0
0

Hi,
I've used the global $post and get_post() a lot but now for some reason they stopped working when I view the site in Chrome incognito mode.
I put a code that sends me an email with the page ID.
I tried both global $post; mail(...,$post->ID,''); as well as the same with $post=get_post();.
In normal browser, it returns the post ID.
When I view in chrome incognito, it returns $post = 1;
Any idea why?
Thanks!

gretakrasteva on "Strange web address is showing on top of my website"

$
0
0

When view the website the 'View Page Source' of my home page '3xgglobalsolutions.com' the following code appears:
</style>http://www.swc-cfc.gc.ca/index-eng.html<meta property="og:title" content="Business Design & Performance Improvement / Personal Financial Solutions / Personal Document Services / Notary Public" />

The part "/www.swc-cfc.gc.ca/index-eng.html" is not entered by me. I have no idea how it got there.

This put http://www.swc-cfc.gc.ca/index-eng. html as text only (not an active link) right on top of my logo, in the background.

I cannot see the code in the "text" version of the home page in WP. It is in the title.

I have no way of removing it.

Please help. Running out of options.

Nothing was added or changed between the site being good and this happening.

Thanks

ijwoods on "Token Acceptance"

$
0
0

My brain is fried and appreciate any help. Can this be done? I have a website (not Wordpress) in which I want participants to launch over to another website built in WordPress (also mine). I'd like to issue a authorization token from the non-WordPress website and then receive that at the Wordpress website when they arrive. Depending on the information contained in the authorization token they would be admitted and brought to a specific category landing page as per the token information. When they are finished at the Wordpress site they can then launch back to the non-Wordpress site being issued a token that would let them back in to their specific page.

Is this doable? Are tokens the best way? Any ideas as to how I might go about this or some good resources to check out?
thanks for any help.

matt.milan on "in my widget, shortcode $variable parameter not working"

$
0
0

I wrapped a plugin with a widget. i want the widget to tell the plugin what to do by sending the widget $title to the plugin shortcode parameter.

echo do_shortcode('[rotating-posts category_name="blog"]');

works

echo do_shortcode('[rotating-posts category_name="$title"]');

does not.

i tried a few different syntaxes,
_name=$title - nothing happens
_name='$title' - crash

I will post the code in the next comment.


JeremyPark123999 on "Allow only specific usernames"

$
0
0

Hi, I am trying to set up a website for my minecraft server. I want to set up the buddypress registration to only allow users to register if their username reads as a premium account on the minecraft.net server. I found a plugin that was meant to do that, but it hasn't been updated for a long time, and it no longer works. I have been trying to alter the plugin, but so far, it hasn't shown any results. As far as I can tell, the plugin is not blocking users, and that is all. Could someone tell me if I have done something wrong?
I have changed the code a lot from the original, but I don't think that I have damaged anything, let me know if you need the original, and I will post it.

EDIT: It turns out that I did damage some of the code, I was getting a very small error on the wordpress plugin page, I fixed that, and upaded the code below.

Here is the plugin's code:

<?php
/*
   Plugin Name: Minecraft Validator
   Description: Simple plugin to verify new WordPress accounts against the Minecraft user database. If the username doesn't show up as a valid Minecraft player, it won't let them register.
   Version: 1.4
   Author: Ghost1227
   Author URI: http://www.ghost1227.com
*/

/* Run activation hook when plugin is activated */
register_activation_hook(__FILE__, 'get_wp_version');

/* Rewrite registration form */
function mcv_registration_form() {
	wp_enqueue_script( 'login_form', plugins_url() . '/minecraft-validator/usernamerewrite.js', array('jquery'), false, false );
}
add_action('login_head', 'mcv_registration_form');

/* Get WordPress version */
function get_wp_version() {
    global $wp_version;
    if ( version_compare ( $wp_version, '3.1', '<')) {
        exit ( "<div style='font-size: 13px; font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', sans-serif;'><strong>Attention:</strong> This plugin will not work with your version of WordPress.</div>" );
    }
}

/* Register actions */
add_action('register_post', 'verify_mc_account', 10, 3);
add_action('admin_menu', 'add_mcval_options');

/* Check account on minecraft.net */
function verify_mc_account($login, $email, $errors) {
	$user_info = get_userdata(1);
	$options = array(
        'timeout' => 5,
    );
    $mcacct = wp_remote_get('http://www.minecraft.net/haspaid.jsp?user='.$user_info->user_login);

    if ( $mcacct == 'false' ) {
        if ( $mcacct == 'false' ) {
            $errors->add('mc_error',__('<strong>ERROR:</strong> Minecraft account is invalid.'));
            return $errors;
        } else {
            $errors->add('mc_error',__('<strong>ERROR:</strong> Unable to contact minecraft.net.'));
            return $errors;
        }
        add_filter('registration_errors', 'verify_mc_account', 10, 3);
    }
}
/* Activation/Deactivation */
function set_mcval_options() {
    add_option('hide_me', 'false');
}

function unset_mcval_options() {
    delete_option('hide_me');
}

register_activation_hook(__FILE__, 'set_mcval_options');
register_deactivation_hook(__FILE__, 'unset_mcval_options');

/* Add admin menu */
function add_mcval_options() {
    if ( get_option('hide_me') != "true" ) {
        add_options_page('Minecraft Validator Options', 'Minecraft Validator', 8, 'mcval-options', 'mcval_options');
    }
}

/* Display options page */
function mcval_options() {

    ?>

    <div class="wrap">
        <h2>Minecraft Validator</h2>

    <?php
        if ( $_REQUEST['submit'] ) {
            update_mcval_options();
            ?>
                <script type="text/javascript">
                <!--
                    window.location = <?php echo "'options-general.php'"; ?>
                //-->
                </script>
            <?php
        }
        print_mcval_form();
    ?>

    </div>

<?php }

function update_mcval_options() {
    update_option( 'hide_me', 'true' );
}

function print_mcval_form() {
    ?>

<?php }

edrdesign on "Editing Thumbnails As They Are Loaded?"

$
0
0

Is there an existing filter to edit the thumbnails as they are loaded? If not, has anybody else had any luck with accomplishing this? I have a client who would like to have the thumbnails generated in a specific way from how WordPress does it by default.

Niranjana on "Passing parameters to a custom page"

$
0
0

I wanna pass $MyVal parameter to Details Page. When I clicked on title link it goes to Details page But I can't get the MyVal parameter value. Please help me. Im really Stuck here

<a href="<?php echo esc_url(get_permalink(get_page_by_title('Details'))) ?>/?MyVal=<?php echo $ID; ?>"><?php echo $print->title;?></a>

tasko on "wp_editor Link Question"

$
0
0

Hello,
Is it possible to hide/remove the "Or link to existing content" section from tinyMCE (link button)?

Melusine29 on "Size image with get_post_meta"

$
0
0

Hello

I get via <img src="'.get_post_meta($listing-> ID, 'image', true)." /> my picture but I want recovered the right size without having to set the width and height in the image tag ..

Regards
Melusine

Viewing all 8245 articles
Browse latest View live




Latest Images