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

SirCharo on "Custom WooCommerce payment gateway redirection issue"

0
0

Hello,
I'm developing a custom payment gateway for WooCommerce to process payments through NetCommerce (a local visa and credit card gateway).
1- Collecting customer information is Working fine
2- Sending the information to the gateway website is Working fine
3- Transactions are being made successfully on the gateway website and they successfully send us a message back with the transaction status if accepted or rejected.
The problem i'm facing is that whenever i receive the message from them i'm having errors changing the order status to "Processing" if the transaction was successful, and an error displaying the message received in the signature whenever the transaction is failing to go through.
The redirection is right i assume since I always get back to checkout whenever i'm done from the payment gateway website with a message saying "Thank you for Shopping".
I'm not sure whats wrong with the final step of the file, i checked many other gateways and i think i did the same.
Does anyone have idea about this issue?
The php file can be found here: http://goldeneagleadv.com/NetCommerce_Gateway.php (Right click + Save target as)
Thank you.


cipriano200 on "display only child taxonomies"

0
0

Hello guys

This code below displays all TAXONOMY categories with images(CATEGORIES IMAGES PLUGIN).

I don't want to show parent category. This is the only problem

Only to show parent child categories.
ANYONE? PLEASE

<?php $custom_terms = get_terms('parchet-cats');
            //find a way to remove parent (ie show all except for pet-care)
            foreach($custom_terms as $custom_term) {
                wp_reset_query();
                $args = array('post_type' => 'parchet',
                    'tax_query' => array(
                        array(
                            'taxonomy' => 'parchet-cats',
                            'field' => 'slug',
                            'terms' => $custom_term->slug,
                            'operator' => 'AND',
							'parent' => 0,
                        ),
                    ),
                 );

                 $loop = new WP_Query($args);
                 if($loop->have_posts()) {
					echo '<a class="trick product-search-item" href="'.$custom_term->slug.'">';
					echo z_taxonomy_image_url($custom_term->term_id);
                    echo '<h2>'.$custom_term->name.'</h2>';
                    echo '</a>';
                 }
            } 

			?>

Evypoo on "Editing the Loop to Exclude a Tag"

0
0

Hello,

I am having some trouble editing my WP homepage loop. Currently, I have a custom post type called woo_video and on my homepage it shows my latest 9 video posts. However, I would like to add the ability to an exclude a video I post from the homepage (perhaps by tagging it something like "skip home"). However, I would still like it to show in the video categories that it was placed in. My code is as follows:

<!-- Start the Loop. -->
 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
 			<!-- PHP Post Code Below. -->

 			<?php
 	echo '<div class="home-videos">';

 			$args = array( 'post_type' => 'woo_video', 'posts_per_page' => 9 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();

	echo '<div class="home-post">';
	echo '<div class="home-post-thumbnail">';

	if ( $woo_options['woo_post_content'] != 'content' ) {
	                		echo '<a href="' . get_permalink( get_the_ID() ) . '" rel="bookmark" title="' . the_title_attribute( array( 'echo' => 0 ) ) . '">' . woo_image_vimeo('meta=' . the_title_attribute( array( 'echo' => 0 ) ) . '&width=310&height=' . $woo_options['woo_thumb_h'] . '&class=thumbnail&link=img&return=true') . '</a>';
	                	}
	echo '</div>';

	echo '<div class="home-post-title">';
	echo get_the_title($ID);
	echo '</div>';
	echo '</div>';

endwhile;

	echo '</div>';
	        ?>

 			<!-- End the Loop. -->
 <?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
            <!-- End. -->

It is probably an easy fix but I can't seem to get it to work. I appreciate your help!

Thank you!

Wolfenstein on "Need help with onclick with shortcode"

0
0

Well right now I have brain lock and this should be simple.
Basically I want to add a onclick event to the content in this function in which it applies a css class.

function my_onclick_handler($atts, $content = null)
{
return "<div onclick= class='my css' >".do_shortcode($content)."</div>";
}

Thanks in advance.

elsnare on "get email out of user_register"

0
0

Hello wordpress community!

I need to get a new user name and most import. email when a account is created.

As far as I know user_register can be used but I had no luck so far.
Thank you for your time.

gglazer on "Plugin or not?"

0
0

In order to support a particular site, I am writing a database administration app and a database query app that will return formatted results to people viewing the page. The db schema is quite particular to the needs of the website and contains many fields that would be useless to almost anyone else.

That said, I am thinking of writing these apps as plugins to help ease installation and update, along with integration into the current WP website. I have no intention of ever publishing the plugins to the public.

Thoughts? Should I bother writing a plugin or should I just write the PHP and make the relevant pages as include files?

zkorwin on "Add user registration info to different table as well"

0
0

Hello,

I have a flash program with a login that runs from the same database where I have my Wordpress install. The program has a registration that goes into the "rsusers" table, and Wordpress obviously has a registration. I want to have it that when people register for my Wordpress site their information is also added to my program's database table "rsusers". I have no experience making my own plugin but I've altered the core Wordpress files before, although I'd prefer it as a plugin so I can update in the future.

So anyway, how would I make a plugin that when a new user registers for my blog it would also run my custom php code to add that information to my other database table?

Thanks!

JusHerb on "Plugin or HAck it out?"

0
0

I have a WordPress site with multiple users. I would like to have a plugin that acts as a invoicing system. Where I would have an hourly rate/wage attached to a users role or entered in a custom field attached to a users profile. Then the user could log in go to a page where they can fill out a form and place the number of hours worked and produce a invoice. Does anyone know of a plugin for this type of function? If there is not a plugin to achieve this anyone have any ideas of how I could achieve this?


juzkyte on "Get query post form tag id in post"

0
0

I want to get other post from tag in post

In a post can have one, two,.. or more tags...

I want to get query post from tag, example: tag_id=1,2,3...

:( Help me...

juzkyte on "Show posts from tags of current post but don't show current post"

0
0
<?php
$posttags = get_the_tags();
if ($posttags) {$dem= 0; foreach($posttags as $tag) {$dstag[$dem]= $tag->term_id; $dem++;}}
$args = array('tag__in' => $dstag);
$the_query = new WP_Query( $args );  ?>

<?php if ( $the_query->have_posts() ) : ?>

<!-- pagination here -->

	<!-- the loop -->
	<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
	<h2><?php the_title(); ?></h2>
	<?php endwhile; ?>
	<!-- end of the loop -->

<!-- pagination here -->

<?php wp_reset_postdata(); ?>

<?php else: ?>
	<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>

I used this code, worked but...
This code will show posts from tags of current post... but, it show current post... Please help me except current post :D

TheBnl on "mixed loop in cms for drag and drop reordering (1 post)"

0
0

Hello,

I'am looking for a way to use drag and drop reordering for a mixed loop.
I like how the post type order plugin adds drag and drop support to the individual post types. But what i'm after is a way to add this functionality to a mixed loop situation.

Does anyone know a plugin that can support this functionality or maybe a way to query two post types into one new post type for example the post types 'posts' & 'products' together make the post type 'mixed'.

Kind regards,
Bram

[closed - please continue with your original topic at https://wordpress.org/support/topic/mixed-loop-in-cms-for-drag-and-drop-reordering?replies=1 ]

coriander on "Manual excerpt - how to keep html tag"

0
0

I have manual excerpts and the <p> and
tags are always stripped...
I'm trying to find out how to keep them!

I've come up with the following function in functions.php, please any suggestions are appreciated.

function custom_wp_excerpt_tags($text) {
  $text = get_the_excerpt();

  $text = strip_tags($text, '<br>');

    return ( $text );
}
remove_filter('get_the_excerpt','strip_tags');
add_filter('get_the_excerpt', 'custom_wp_excerpt_tags');

alirezaChimeh on "Show posts that are in cat=1 and cat=2"

luciendub on "strtotime returns strange characters"

0
0

I want to show date of events created via custom post type and ACF in WordPress. I try to figure out why this:

<?php setlocale(LC_TIME, 'fr_FR'); echo strftime('%d %h %Y', strtotime(get_field('date_de_levenement'))); ?>

returns strange characters like this:

04 ao�t 2014

(Here the 04 ao�t 2014 should be 04 août 2014)

azor_ahai on "Adding Class to Container based on Post Thumbnail Orientation"

0
0

I have a script in my functions that adds a class to the featured image based on whether it is landscape or portrait. It works by measuring the height against the width of given post thumbnail and appending the class from "attachment-" into "horizontal-image attatchment-".

if ( ! function_exists( 'mytheme_vertical_check' ) ) :
	function mytheme_vertical_check( $html, $post_id, $post_thumbnail_id, $size, $attr ) {

		$image_data = wp_get_attachment_image_src( $post_thumbnail_id , 'large' );

		//Get the image width and height from the data provided by wp_get_attachment_image_src()
		$width  = $image_data[1];
		$height = $image_data[2];

		if ( $width > $height ) {
			$html = str_replace( 'attachment-', 'horizontal-image attachment-', $html );
		}
		return $html;
	}
endif;

add_filter( 'post_thumbnail_html', 'mytheme_vertical_check', 10, 5 );

However, instead of adding "horizontal-image" to the actual IMG class, I need it to be added to the container's class. The container is a div with the class "masonry-thumbnail". So I would like the appropriate containers to instead have "masonry-thumbnail horizontal" as their class.

Note: The original writer of this function suggested that I used a jQuery fix, and after trying several different strings of code, I realized that it did not work well with Infinite Scroll and would therefore be better of with the modification coming from inside WordPress itself by way of functions, just like the original code (which works perfectly) appending the class when the page initially renders, as opposed to post-page load through jQuery. Besides, I'd like to use as little javascript as possible.

I thought this would be a simple problem to solve, but days have now passed and I'm losing hair. If anybody can lend a hand, or point me in the right direction, that would be fantastic. Thank you.


jstudios on "[Multisite] Set cookies for mirrored domain (subsite)..."

0
0

I have a wordpress multisite at domain.com and I'm using subdomains for all the sites, except the parent one of course.

I am also doing a "symlink" for one of the sites with my hosting company. In other words, in my hosting server, site1.com points to domain.com and WordPress knows that site1.com should show site1.domain.com because of the Domain Mapping plugin.

I'm having a lot of log in/out issues, mainly when logging out though. I notice that I have no choice but to clear the browser's cookies so I can "log out", otherwise I keep getting redirected to the page I was in while staying logged in (when I click on a log out link). I've tried using wp_logout_url() on a link and also a custom sign out page where I run wp_clear_auth_cookie(), but neither of them work. This is only happens at random times though and it works fine for a while after manually deleting the browser cookies.

After doing some research it seems that the way the multisite and domain mapping works causes this issue since I have site1.domain.com hidden behind site1.com and maybe it's creating cookies in a weird way.

What should I do and should I have site1.com everywhere on the Site's Network settings or keep site1.domain.com on some of the settings?

mdp9000 on "place short code into html area of lightbox"

DRandy on "How do you get a form field value into a function variable"

0
0

Hi. I added a simple one field form on a page. The user enters a value in that field and submits. Then that value is assigned as a variable in my function before returning. For example, my user enters a zip code in the field. Based on that zip code, my function returns all users in the zip code. I just need to know how to get that value assigned as a variable in my function.

Thanks for your help.

aldajl on "wp_editor spitting out plugin's code"

0
0

Hello,

I'm creating a textarea using wp_editor, but instead of printing out '' (empty string), it's printing out code for the digg digg plugin.

So for example. I use wp_editor( $content, $id, array('media_buttons' => false, 'quicktags' => false, 'textarea_rows' => 15, 'teeny' => true));

but then instead of being empty, it returns this

<ul id="sharebar" style="background:#;border-color:#;">
<li><script type="text/javascript">(function() { var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0]; s.type = 'text/javascript'; s.async = true; s.src = 'http://widgets.digg.com/buttons.js'; s1.parentNode.insertBefore(s, s1); })(); </script><a class="DiggThisButton DiggMedium"></a></li><li><a href="http://twitter.com/share" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','http://twitter.com']);" class="twitter-share-button" data-count="vertical" data-via="ThinkDevGrow">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></li><li><script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><span class="st_facebook_vcount" displayText="Share"></span><span class="st_email" displayText="Email"></span><span class="st_sharethis" displayText="Share"></span></li></ul><ul id="sharebarx">
<li><script type="text/javascript">(function() { var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0]; s.type = 'text/javascript'; s.async = true; s.src = 'http://widgets.digg.com/buttons.js'; s1.parentNode.insertBefore(s, s1); })(); </script><a class="DiggThisButton DiggCompact"></a></li><li><a href="http://twitter.com/share" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','http://twitter.com']);" class="twitter-share-button" data-count="horizontal" data-via="ThinkDevGrow">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></li><li><span class="st_facebook_hcount" displayText="Share"></span><span class="st_email" displayText="Email"></span><span class="st_sharethis" displayText="Share"></span></li></ul>

any idea on how to fix this?

thomasario on "User profile enhancement - can the Wordpress core support this easily?"

0
0

I’m wanting to enhance the standard "User > Your Profile" page.

I need to allow a user to create and associate simple (but potentially multiple records) with their account.

Example as follows;

The site will cater for pet owners who may have a single, multiple (or possibly at present no) pets.

So I’d like a "Add pet" button, a list of current pets with an associated "Edit or delete" option.

I have limited Wordpress experience.

I’m not asking for all the code! But I’d like a pointer in the right direction. I’m not sure whether out of the box the core functionality will cater for this many to one relationship or whether I’ll need to start making new MySQL tables etc.

If someone can point me in the right direction I’d be very grateful.

Viewing all 8245 articles
Browse latest View live




Latest Images