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

Angela928 on "Embellishing an embedded Gmap"

$
0
0

Greetings,

Rookie here:
So I have an embedded map on a page:

<iframe style="border: 0;" src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d44841.91957184977!2d-73.48592535063469!3d45.376663205928814!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x4cc90c22121db963%3A0x6a7c38f4325f101b!2s16+Rue+de+Dinard%2C+Candiac%2C+QC+J5R+6V5!5e0!3m2!1sen!2sca!4v1442699501415" width="600" height="450" frameborder="0" allowfullscreen="allowfullscreen"></iframe>

and want to add some borders, drop shadows, etc... like here:
http://www.westchasestampede.com/events/u9-stampede-vs-clearwater/

I even have the code:
.em-location-map {
border:2px solid gray;
box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.42);
-moz-box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.42);
-webkit-box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.42);
}

Here is where the rookie part comes in: Where do I place the code? i.e.: what is the entire syntax for what I am trying to do, I tried before, after, wrapping, etc... I just can't get it right.

Can someone please right the entire thing so that I can just learn by seeing and understand for the next time I need to do this.

Thank you


petokozma on "Site hacked, mallware create wevery day folder .X1-unix"

$
0
0

Every day in random folder mallware creates folder ".X1-unix"
this folder is filled with folders like "482,a25,a25,..."
Preview of folder

First mallware add to the mo.php code liek this

<?php @include_once("/nfsmnt/hosting2_2/w/e/wer76dd3-c570-4a51-as98-bf5eddd/mojweb.eu/web/wp-content/plugins/better-wp-security/core/modules/content-directory/index.php.php"); ?><?php @include_once("/nfsmnt/hosting2_2/w/e/wer76dd3-c570-4a51-a098-bf5e66d/mojweb.eu/web/wp-content/plugins/lightbox-plus/css/shadowed/images/internet_explorer/index.php.php"); ?>

preview of infected file index.php.php

I scanned my website with Anti-Malware, Wordfence. Bud dint find mallware. When infected files appears on my web this anti malware scanners find something. I delete them but next day they are again in another random folder.

I changed passwords.

Can you help me pleas?

Daniel M. on "More than one "category" field in the editor to build a PDF library"

$
0
0

Hi!

I'm looking for a way to choose the categories of an article/page in more than one fields. Actually, I'm trying to build a virtual library and I want to choose in one field "Year", in another one "type", "Author", etc.

I'm investigating with the custom fields but it has been impossible for me. Is there any hack to do that?

Thanks.

wesmelville on "Featured Images - Resizing on homepage"

$
0
0

I'm having difficulty guaranteeing consistency of my featured images when displayed on the home page: http://www.thymefries.com/. A few of my photos appear on the homepage longer than the others when they should all be of uniform length and width. For some reason, the width is always uniform even if the length is not.

I am using the Rowling theme.

Thoughts? What are options for fixing this problem?

Thank you,

Wes

Rob Gelhausen on "Wordpress Plugin Not Providing Updates To Users of Older Versions"

$
0
0

I will donate $25 to the person that answers my question and helps me get this fixed.

I have updated our plugin Local SEO and Business Listings. When you download the Plugin everything is fine. The user gets the latest updated version.

The problem is that the current users do NOT get update notifications. When you look at the download link on the Plugin Page it just says Download. There is no version number.

I have followed the Plugin Update instructions to a tee provided in the article below and via the Wordpress help section. I have even tried to update the plugin a few different ways with no success.

http://premium.wpmudev.org/blog/wordpress-subversion/

Thank you for your help.

SymbiDev on "Comment tags added into my plugin"

$
0
0

I created a widget which can be activated as a plugin. My widget, upload, and form functions look like so:

function widget($args, $instance)
{
    //code goes here
                            ?>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    <?
}

function update($new_instance, $old_instance)
{
   return $new_instance;
}

function form( $instance )
{
    ?>
    <!--html for form in admin-->
    <?php
}

However when viewed from the site it shows the html elements inside my form function and when inspected you can see that the PHP tags have been changed to html comment tags. like so:

<!--?
    }

    function update($new_instance, $old_instance)
    {
        return $new_instance;
    }

    function form( $instance )
    {
        ?-->

Si Wilson on "Add category to recent post list on footer?"

$
0
0

Hi, I'm looking to add the category under each latest post in the footer widgets section, could someone point me in the right direction?

Latest version of wordpress using the Underscores theme.

Thanks, Si

j1lyon1 on "Execute if else inline on page"

$
0
0

Hi,

I was wondering if there is a simple way to use an if/else statement on a worpress page in the editor to execute 2 different sets of html, based on the size of the screen. For ex.
if the screen size is >= #{use this html}
else{use this html}

I am trying to use code for two diff sized widgets depending on whether it is a desktop or mobile.

I would hopefully like to do this inline using wordpress dashboard editor and not have to go and mess with css files or the likes as I am still new to it. Again, I stress simple.

Thanks!!


lestatu2 on "Change wp role after a trial period"

$
0
0

When a user complete an order I change his role from customer to vip_customer (custom role) with this code

function wpa_120656_convert_paying_customer( $order_id ) {

    $order = new WC_Order( $order_id );

    if ( $order->user_id > 0 ) {
        update_user_meta( $order->user_id, 'paying_customer', 1 );
        $user = new WP_User( $order->user_id );

        // Remove role
        $user->remove_role( 'customer' );

        // Add role
        $user->add_role( 'vip_customer' );
    }
}
add_action( 'woocommerce_order_status_completed', 'wpa_120656_convert_paying_customer' );

now , I need a way to rechange wp role to woocommerce customer after a trial period of 1 year.

Can you Help me?

rrfranco92 on "Adding a custom taxonomy to a SQL Query"

$
0
0

Hello Guys,

I'm trying to implement a new search option in store locator plugin.

I needed to add a custom taxonomy and I was successful with it but now I need it to work with the search system.

I have this SQL Query, which the plugin dev pointed me at, but I don't know much about SQL so I'm asking for your help.

$cat_filter = "INNER JOIN $wpdb->term_relationships AS term_rel ON posts.ID = term_rel.object_id
                               INNER JOIN $wpdb->term_taxonomy AS term_tax ON term_rel.term_taxonomy_id = term_tax.term_taxonomy_id
                                      AND term_tax.taxonomy = 'wpsl_store_category'
                                      AND term_tax.term_id = %d";

Here I need to add the option of also search by my new custom taxonomy, which is called wpsl_custom_category.

I already tried adding by duplicating
AND term_tax.taxonomy = 'wpsl_custom_category'
but then neither of the search fields work.

Can you please help me with this?

jeegrobot on "Retrieving data from database"

$
0
0

Hi everyone,

I'm trying to write a plugin that should retrieve data from the database and display them, but for some reason it's not working. This is my code

global $wpdb;
	$domande = $wpdb->get_results( "SELECT * FROM ".$wpdb->prefix."tstile ORDER BY Posizione_Gruppo ASC, Posizione_Domanda ASC;");

	$arrayDomande = array();
	foreach($domande as $domanda) {
		if (!isset($arrayDomande[$domanda->Posizione_Gruppo])) {
			$arrayDomande[$domanda->Posizione_Gruppo] = array('gruppo' => $domanda->Gruppo, 'domande' => array());
		}
		$arrayDomande[$domanda->Posizione_Gruppo]['domande'][$domanda->Posizione_Domanda] = array(	'ID' => $domanda->ID,
																									'domanda_sx' => $domanda->Domanda_Sx,
																									'domanda_dx' => $domanda->Domanda_Dx,
																									'valore_sx' => $domanda->Valore_Sx,
																									'valore_dx' => $domanda->Valore_Dx);
	}

?>
<form name="frm_stile" id="id_frm_stile" method="post">
<?php wp_nonce_field('nonce_save_test_stile','nonce_stile'); ?>
<input type="hidden" name="action" value="save_t_stile" />
   	<table class="table_test ab">
		<thead class="table_header">
			<tr>
				<th class="h_risposta"></th>
				<th class="h_domanda" width="45%">Opzione</th>
				<th class="h_text">#</th>
				<th class="h_domanda domanda2" width="45%">Opzione</th>
				<th class="h_risposta"></th>
			</tr>
		</thead>
<?php
	$ix = 1;
	foreach($arrayDomande as $posizioneGruppo => $infoGruppo) {
?>
		<tbody>
			<tr>
				<th colspan="5" class="gruppo"><?php echo sprintf("Gruppo %s", ($ix)) ?></th>
			</tr>
<?php
		$iy = 1;
		foreach($infoGruppo['domande'] as $opzione) {
?>
			<tr class="<?php echo($iy%2==0?'odd':'even'); ?>">
				<td class="input" width="1">
					<input type="hidden" name="ixd[<?php echo sprintf($opzione['ID']);?>]" value="<?php echo sprintf("%s,%s", $iy, $ix); ?>" />
					<input type="radio" name="r[<?php echo sprintf($opzione['ID']); ?>]" id="id_domanda_sx_<?php echo sprintf($opzione['ID']); ?>" value="sx"/>
				</td>
				<td class="domanda"><label for="id_domanda_sx_<?php echo sprintf($opzione['ID']); ?>"><?php echo sprintf($opzione['domanda_sx'])?></label></td>
				<td class="text numero-domanda"><?php echo sprintf($iy); ?></td>
				<td class="domanda domanda2"><label for="id_domanda_dx_<?php echo sprintf($opzione['ID']); ?>"><?php echo sprintf($opzione['domanda_dx'])?></label></td>
				<td class="input"  width="1"><input type="radio" name="r[<?php echo sprintf($opzione['ID']); ?>]" id="id_domanda_dx_<?php echo sprintf($opzione['ID']); ?>" value="dx"/></td>
			</tr>
<?php
			$iy++;
		}
?>
		</tbody>
<?php
		$ix++;
	}
?>
		<tfoot>
			<tr>
				<td colspan="5"><button id="btnSave">Salva e visualizza risultato</button></td>
			</tr>
		</tfoot>
	</table>
</form>

Any help? Thanks in advance.

mrpolab on "Show content if there are h2, else show different stuff"

$
0
0

HI!
I need your help! I'll try to explain:

When a post has 2 or more h2, then a table of contents is shown at the top of the post. I just want to show a banner where there are no heading tags (h2-h6), after 2 paragraphs and after 4 when there is the TOC. I think I can use the h2 to create the code but I don't Know how.

I need something like

if there are h2
then show a code snippet to show the banner after 2 paragraphs
else
if there aren't h2
then show a code snippet to show the banner after 2 paragraphs

Can you please help me, translating this to php?

The snippet to show banners is: http://pastebin.com/9d15rBi9

sholac on "WP server connection type"

topheman on "Login to WP through external site credentials"

$
0
0

I'm currently researching for a plugin I need to write.

We need to allow members of an organisation to login to their WP-site, by authenticating on an external site. So they should not have to have a WP user account.

Like this:

1. User logs in to WP.
2. Login plugin checks user details in an external system though API calls
3. The external system recognized the user details
4. The user is authorized as logged in to the WP site.

Is this possible and does anyone have any links to article about this or even plugins that does similar things

denfriskadiabetikern on "Reinstall SimplePie and wp-admin/css"

$
0
0

I got hacked and replace my themes and plugins. Scan points out SimplePie and css also. Is there any easy way to reinstall those libraries?


dimig on "Reordering header elements with a child theme leads to undefined error"

$
0
0

Hey! I'm a newbie WP user, so please be kind.

I'm using a premium stock theme. In order to reorder my header's menus, I copy-pasted header.php into a child theme's function.php and reordered the code.

When I save the changes and try to reload the site, I'm given a fatal error message that ct_tracks_social_site_list() is undefined in a file.

I tried copy-pasting the referenced file's code into the child theme's functions.php, too, but that just leads to more errors.

Am I on the right track? If so ...

While I am somewhat familiar with coding, I don't know PHP or WordPress. Are there some rules I have to obey when copying code from different files into the child theme's functions.php file?

Here is the code referenced by the undefined error: http://pastebin.com/ySCtE94q I'm not even using any of the social networks mentioned in the file anywhere on the site.

I like screenshots on "Copy an author's CPT post custom field to the same author's normal post"

$
0
0

I'm trying to copy an author's CPT post custom field (and value) to the same author's normal post.

Here's the scenario...
Author publishes a CPT post with a custom field, then the same author publishes a normal post. I want the normal post to be automatically populated/updated with the custom field (and value) of the previous CPT post.

When the custom field/s of the CPT post is updated so should the custom field of the author's normal posts.

Here's what I have so far, the problem is the normal post custom field is populated with the last CPT post of ANY author, not the normal post's author...

function wpse_203349_copy_post_meta( $post_ID, $post, $update ) {
    if ( $post->post_type !== 'post' )
        return;

    $users_custom_posts = get_posts(
        array(
            'posts_per_page' => 1,
            'post_author' => $post->post_author,
            'post_type' => 'custom_post_type',
        )
    );

    if ( ! $users_custom_posts )
        return; // This author doesn't currently have any custom posts

    $fields = get_post_custom( $users_custom_posts[0]->ID );

    foreach ( $fields as $field => $value ) {
        if ( $field[0] !== '_' && ( empty( $value[0] ) || ! is_array( $value[0] ) ) ) // Ignore "private" fields (prefixed with an underscore or serialized data)
            add_post_meta( $post_ID, $field, empty( $value[0] ) ? '' : $value[0], true /* Unique */ ); // If the field already exists, it won't be overwritten, unlike update_post_meta()
    }
}

add_action( 'wp_insert_post', 'wpse_203349_copy_post_meta', 10, 3 );

natostanco on "can't use less then symbol in shortcodes"

$
0
0

Whenever I use the less then symbol "<" the shortcode is not read at all, and its text code is rendered in the page ???

b.szakal on "Append CPT to own admin menu"

$
0
0

I have little problem, i have not idea how to do this.

I create own plugin. I need to create a few admin pages and custom post type with taxonomies. First thing I do is adding top level menu page (add_menu_page), next steps is adding another sub menu pages (add_submenu_page).
I have structure in admin menu like this:
Top Plugin Page
-> plugin submenu
-> plugin settings

Now how i can add my custom post type and taxonomies to this structure. For example:
Top Plugin Page
-> plugin submenu
-> Custom Post Type
-> Add new CPT
-> CPT tax
-> plugin settings

I tried to do it in two ways.
1. Adding submenu page for all pages from CPT and taxonomies what i need to display, e. g.
add_submenu_page('prim_menu_slug', 'CPT', 'CPT', 'level_7', 'edit.php?post_type=my_cpt');
but the effect does not satisfy me because for taxonomies and editing CPT this menu isn't activated.

2. While creating CPT I was setting up an argument 'show_in_menu' => 'Top_Plugin_Page_slug', and adding submenu page for "Add new CPT", but this time I can't add taxonomies and I have not Top Plugin Page, only something like this:
Top Plugin Page == Custom Post Type
-> Custom Post Type
-> Add new CPT
-> plugin submenu
-> plugin settings

I have not idea how to merge my plugin menu with menu like have custom post types. Of course i can leave the default menus but I don't want and it is ugly solution.

weezieb on "Deleted users in phpMyadmin but they're not deleted in dashboard"

$
0
0

I recently updated a site I hadn't been editing in a while. It had accumulated 37,000+ users- mostly spam. Because it was a newly updated site we decided to delete all of the subscribers and only keep the administrators and authors. I manually deleted the 37,000+ subscribers in phpMyAdmin. They no longer show up in the users>subscribers- it says no subscribers found. But in the top bar it still shows them in parenthesis by subscribers. And I have a newsletter plugin that wants me to upgrade because of this large number. How can I get that to the correct new subscriber number?

Viewing all 8245 articles
Browse latest View live




Latest Images