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

jowelboss on "want to build custome donation progress plugin with my own images"


tamdab on "SITE URL"

$
0
0

I am totally new at site designing using Xampp and I changed my site url and wordpress address from http://localhost/wordpress to http://modelicious.me.
I totally lost login access to my site.
I used the phpmyadmin database and edited the site url and home in the wp_options back to http://localhost/wordpress. But I only get the login page and as soon as I fill in the username and password, it takes me back to the login page but with header warnings.

What to do??

jmdelmar on "Where to Start? Football Stats..."

$
0
0

Among the many things I try to do with my free time, youth football coaching is one of my favorites. I've created a simple Excel sheet for tracking game stats with many pivot tables as reports. I'd really like to turn this into a WP Plugin so youth coaches and programs everywhere can have a simple web based tool for their teams.

Can someone tell me a good resource to get started for a project like this? I don't have a strong programing background but over the years I've been able to create many html, .net and PHP sites implementing or modifying freeware code.

Thanks!

Piotr on "Dynamically adding forms and options"

$
0
0

I'm continuing my work on a Wordpress site that uses forum posts as content (more on this can be found here and here).

After creating news section which takes first post of every topic and turns it into a Wordpress post I need something more complicated - a section of articles. This requires taking the first post of a topic and appending the remaining posts to the first one - just like chapters in the article. And actually this is something that I've already achieved. I'm using a second query to get posts from a topic, and by using variables for topic IDs and post IDs I can even specify which posts will be imported and appended. The problem is I need to be able to add, edit or remove topics and posts IDs from the query. After using settings API in the news section I thought that it wouldn't be too difficult to use it here, but sadly it is. And this is where I need help.

What I need is an options page that will list all the topics and posts IDs, and let me add, edit or delete these settings and will update the list. I tried to use the settings API, to add a pair of forms every time an option is added, but I'm not even close to what I need. I'm not even sure if storing a multidimentional array ( article# => array( topic_id => 'value', posts_ids => 'values' ) ) as an option is a good idea. I'll be grateful for any ideas.

plasmax on "Smooth Scrolling"

$
0
0

Hey guys, hope to be in the right section.

I'm building a wordpress based website, all the theme is nice, responsive and modern, but I don't like when I scroll down with the mouse wheel because it's not fluid.

I would like some script or something similar to increase the frame rate when scrolling up and down, something fluid instead of jumping 30/40 pixels for every snap I do with the wheel.

I'm not sure you understand what I mean, in that case I'm really sorry!

thank you!

LindaHeron on "I've been hacked!"

$
0
0

Hi our website is hosted at NetFirms, and our website has been hacked - viagra commercials. I am a novice and am not sure I can fix this myself. Netfirms did a scan and found 14 files that have been infected with Malware. They suggested I delete the infected files (I have no idea how to do that) and purchase SiteLock Premium to clean and protect my site at http://www.vermilionriverstewards.ca. We are a not-for-profit and have a very limited budget, so I'm wondering if there is anyone out there who can help me.

The infected files:

/home/users/web/b2731/nf.vermilionriverstewards/public_html/vermilionriverstewards.ca/configweb/config.root: SiteLock-PHP-CPANEL-b.UNOFFICIAL FOUND
/home/users/web/b2731/nf.vermilionriverstewards/public_html/vermilionriverstewards.ca/configweb/.htaccess: EIG.Hacktool.HTAccess.Root-1.UNOFFICIAL FOUND
/home/users/web/b2731/nf.vermilionriverstewards/public_html/vermilionriverstewards.ca/wp-rss3.php: SiteLock-PHP-INJECTOR-1.UNOFFICIAL FOUND
/home/users/web/b2731/nf.vermilionriverstewards/public_html/vermilionriverstewards.ca/wp-content/themes/purevision/functions.php: LONGDEF.PHP.Spam-Links-009N.UNOFFICIAL FOUND
/home/users/web/b2731/nf.vermilionriverstewards/public_html/vermilionriverstewards.ca/wp-content/themes/purevision/scripts/admin/uploadify/Shell.php: SiteLock-PHP-BACKDOOR-GENERIC-md5-to.UNOFFICIAL FOUND
/home/users/web/b2731/nf.vermilionriverstewards/public_html/vermilionriverstewards.ca/wp-content/themes/purevision/scripts/admin/uploadify/uploadify.php: EIG.Hacktool.Deface.Tag-63.UNOFFICIAL FOUND
/home/users/web/b2731/nf.vermilionriverstewards/public_html/vermilionriverstewards.ca/wp-content/themes/purevision/scripts/DD_belatedPNG_0.0.8a-min.php: JCDEF.PHP.INJECTOR-01N.UNOFFICIAL FOUND
/home/users/web/b2731/nf.vermilionriverstewards/public_html/vermilionriverstewards.ca/wp-content/themes/purevision/scripts/timthumb.renamed.txt: EIG.PHP.TimThumb-108.UNOFFICIAL FOUND
/home/users/web/b2731/nf.vermilionriverstewards/public_html/vermilionriverstewards.ca/wp-content/plugins/weather-de.php: SiteLock-PHP-MINISHELL-1-g.UNOFFICIAL FOUND
/home/users/web/b2731/nf.vermilionriverstewards/public_html/vermilionriverstewards.ca/wp-content/uploads/2011/03/purevision.zip: EIG.PHP.TimThumb-108.UNOFFICIAL FOUND
/home/users/web/b2731/nf.vermilionriverstewards/public_html/vermilionriverstewards.ca/chpass.sh: SiteLock-PHP-BACKDOOR-GENERIC-md5-qr.UNOFFICIAL FOUND
/home/users/web/b2731/nf.vermilionriverstewards/public_html/vermilionriverstewards.ca/sym/.htaccess: EIG.Hacktool.HTAccess.DirIndex-1.UNOFFICIAL FOUND
/home/users/web/b2731/nf.vermilionriverstewards/public_html/vermilionriverstewards.ca/index.htm: SiteLock-JS-SEOSPAM-g.UNOFFICIAL FOUND
/home/users/web/b2731/nf.vermilionriverstewards/public_html/vermilionriverstewards.ca/groupx.php: SiteLock-PHP-BACKDOOR-GENERIC-md5-n.UNOFFICIAL FOUND

----------- SCAN SUMMARY -----------
Known viruses: 4389639
Engine version: 0.96.3
Scanned directories: 554
Scanned files: 4939
Infected files: 14
Data scanned: 1346.86 MB
Data read: 1532.18 MB (ratio 0.88:1)
Time: 624.750 sec (10 m 24 s)

Ale12 on "How category or taxonomy data on its admin panel get populated?"

$
0
0

Hello,

Hope you have nice warm day.

Can you direct me to documentation about category/taxonomy admin panel data populate process, please?

I need to modify or filter the data that will be displayed on the taxonomy admin panel.

If there are other functions/admin/hook for this, could you please let me know?

Thank you very much for your time and your help.

Best regards,

-Ale12

Tiago Sa on "Function to retrieve comment panel"

$
0
0

Hi. I have a PHP function that retrieves the comment panel of a post. I retrieve the result by javascript and load it dynamically in the post. But, although everything else works fine, it doesn't detect that there are comments. Effectively the have_comments() returns false. However, if I force it to true, get_comment_pages_count() returns 0, get_option( 'page_comments' ) and basically comment listing doesn't work. Why is that?

include ( '../../../../wp-load.php' );
$t = 0;
if ( isset ( $_GET [ 'dwid' ] ) && intval ( $_GET [ 'dwid' ] ) > 0 ) $t = $_GET [ 'dwid' ];
$query = new WP_Query ( 'posts_per_page=1&include=' . intval ( $_GET [ 'dwid' ] ) );
if ( $query -> have_posts() ) {
	while ( $query -> have_posts() ) {
		$query -> the_post();
		if ( !post_password_required() ) { ?>
			<div id="comments"><?php comments_template();
				if ( have_comments() ) { ?>
					<h2 id="comments-title"><?php printf( _n( 'One thought on &ldquo;%2$s&rdquo;', '%1$s thoughts on &ldquo;%2$s&rdquo;', get_comments_number(), 'wpportgall' ), number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); ?></h2>
					<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
					<nav id="comment-nav-above">
						<h1 class="assistive-text"><?php _e( 'Comment navigation', 'wpportgall' ); ?></h1>
						<div class="nav-previous"><?php previous_comments_link( __( '&laquo; Older Comments', 'wpportgall' ) ); ?></div>
						<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &raquo;', 'wpportgall' ) ); ?></div>
					</nav>
					<?php endif; ?>
					<ol class="commentlist">
						<?php wp_list_comments( array( 'callback' => 'wpportgall_comment' ) ); ?>
					</ol>
					<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
					<nav id="comment-nav-below">
						<h1 class="assistive-text"><?php _e( 'Comment navigation', 'wpportgall' ); ?></h1>
						<div class="nav-previous"><?php previous_comments_link( __( '&larr; Older Comments', 'wpportgall' ) ); ?></div>
						<div class="nav-next"><?php next_comments_link( __( 'Newer Comments &rarr;', 'wpportgall' ) ); ?></div>
					</nav>
					<?php endif;
				} elseif ( !comments_open() ) { ?>
					<p class="nocomments"><?php echo dwTranslate ( 'Os comentários estão fechados.', 'Comments are closed.' ); ?></p>
				<?php } ?>
				<?php if ( comments_open() ) comment_form(); ?>
			</div><!-- #comments -->
		<?php } else echo dwTranslate ( 'Os comentários estão fechados.', 'Comments are closed.' );
	}
} else echo dwTranslate ( 'Os comentários estão fechados.', 'Comments are closed.' );

AhmadKhan on "same permalink for posts in seperate categories"

$
0
0

Hi,
I wana make some post with same permalinks in seprate categories.
for example:
I have post 1 with P1 permalink in cat1 and have post 2 with P2 permalink in cat2. now I wana change P2 to P1.
at the end:
I want this structure:
localhost/cat1/p1
localhost/cat2/p1
but wordpress automatically add -2 to the changed permalink..

Plz help me...
thx alot...

olyma on "Turning Off Open Sans for the 3.8 Dashboard"

$
0
0

I’m looking for a way to turn off the Open Sans font in the admin. I’m already using the code below to force the admin area to use a different font:

function betterfonts1() {
?>
<style type="text/css">
body {font-family: Times New Roman,Times;}
</style>
<?php
}
add_action( 'admin_head', 'betterfonts1' );

This works really well, but the Open Sans is still being called in the header. It looks like this in the header:

<link rel='stylesheet' id='open-sans-css' href='//fonts.googleapis.com/css?family=Open+Sans%3A300italic%2C400italic%2C600italic%2C300%2C400%2C600&subset=latin%2Clatin-ext&ver=3.8' type='text/css' media='all' />

For efficiency I’d like to have the call be turned off completely. I’ve tried the following bit of code:

function removeopensans() {
	wp_deregister_style( 'open-sans' );
}
add_action( 'admin_enqueue_scripts', 'removeopensans' );

And this works, but it completely removes the stylesheet so there is zero styling for all of the admin. I’ve also fiddled with the core file script-loader.php by commenting out line 634:

// $open_sans_font_url = "//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=$subsets";

Commenting out this bit of the core file does the trick. It turns off the open sans font call in the header but keeps the general admin styling. Is there a way to turn off the open sans font in the admin without fiddling with core files?

Pjadek on "Jetpack comments - Reply Link"

$
0
0

When I click "Reply" to a comment, I have to click the box AGAIN to type the comment. How to make the cursor to go right away?

Rob Eschauzier on "Hook called when attachment get's removed"

$
0
0

Hey guys and girls,

I'm writing a plugin to delete duplicate attachments (overwrite uploads didn't work for me), but I'm having trouble with preserving the file if you delete one of the media attachment dependent on it.

I'm looking for a hook that get's called when you remove an attachment. I already found one that works when adding an attachment (wp_handle_upload_prefilter), but no such luck for the deletion of attachments.

The hooks I have already tried and did not work for my needs:

before_delete_post
delete_attachment
wp_delete_attachment

Thanks.

MaxSan on "how exclude one category of lists"

$
0
0

Greetings friends, I'm a cruel doubt how to delete only one category of posts related to my topic, I've tried everything I found on the internet but it did not work out, I would like to exclude from the listings only category whose id 12. how to do? follows the code. Dese ja appreciate the help of todos.Obrigado

<?php

global $get_meta , $post;

if( ( tie_get_option('related') && empty( $get_meta["tie_hide_related"][0] ) ) || ( isset( $get_meta["tie_hide_related"][0] ) && $get_meta["tie_hide_related"][0] == 'no' ) ):
	$related_no = tie_get_option('related_number') ? tie_get_option('related_number') : 3;

	global $post;
	$orig_post = $post;

	$query_type = tie_get_option('related_query') ;
	if( $query_type == 'author' ){
		$args=array('post__not_in' => array($post->ID),'posts_per_page'=> $related_no , 'author'=> get_the_author_meta( 'ID' ));
	}elseif( $query_type == 'tag' ){
		$tags = wp_get_post_tags($post->ID);
		$tags_ids = array();
		foreach($tags as $individual_tag) $tags_ids[] = $individual_tag->term_id;
		$args=array('post__not_in' => array($post->ID),'posts_per_page'=> $related_no , 'tag__in'=> $tags_ids );
	}
	else{
		$categories = get_the_category($post->ID);
		$category_ids = array();
		foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
		$args=array('post__not_in' => array($post->ID),'posts_per_page'=> $related_no , 'category__in'=> $category_ids );
	}
	$related_query = new wp_query( $args );
	if( $related_query->have_posts() ) : $count=0;?>

	<section id="related_posts">
		<div class="block-head">
			<h3><?php _e( 'Related Articles' , 'tie' ); ?></h3><div class="stripe-line"></div>
		</div>
		<div class="post-listing">
			<?php while ( $related_query->have_posts() ) : $related_query->the_post()?>
			<div class="related-item">
				<?php if ( function_exists("has_post_thumbnail") && has_post_thumbnail() ) : ?>
				<div class="post-thumbnail">
					<a href="<?php the_permalink(); ?>" title="<?php printf( __( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
						<?php tie_thumb('', 272 ,125); ?>
						<span class="overlay-icon"></span>
					</a>
				</div><!-- post-thumbnail /-->
				<?php endif; ?>
				<h3><a href="<?php the_permalink(); ?>" title="<?php printf( __( 'Permalink to %s', 'tie' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
				<p class="post-meta"><?php the_time(get_option('date_format')); ?></p>
			</div>
			<?php endwhile;?>
			<div class="clear"></div>
		</div>
	</section>
	<?php	endif;
	$post = $orig_post;
	wp_reset_query();
endif; ?>

Pete on "Display Categories Assigned to a Post (with hierarchical list styling)"

$
0
0

I have some code that shows how to "Display Categories Assigned to a Post" with each category separated by a
. However, I'd like to display this in a list/hierarchical tree.

Any help greatly appreciated.

Love Pete x

This is what I have...

<?php
$taxonomy = 'category';

// get the term IDs assigned to post.
$post_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) );
// separator between links
$separator = ', ';

if ( !empty( $post_terms ) && !is_wp_error( $post_terms ) ) {

	$term_ids = implode( ',' , $post_terms );
	$terms = wp_list_categories( 'title_li=&style=list&hierarchical=1&echo=1&taxonomy=' . $taxonomy . '&include=' . $term_ids );
	$terms = rtrim( trim( str_replace( '<br />',  $separator, $terms ) ), $separator );

	// display post categories
	echo  $terms;
}
?>

But i'd

cadfile on "Conditionally write open graph meta property in header"

$
0
0

Have a function I use to print Open Graph tags in the header of each page. I also use a plugin to post to Facebook which also puts in it's own set of basic OG Tags. Facebook doesn't like if a page as more than one og:url tag. The plugin only works on single pages so I want to not print my og:url tag when it is on a single post page. I want to test for is_home and is_tag and if those are true the function will print the og:url tag. The other problem is the home page has a completely different url than the tag page. I tried doing the conditional inside the meta property tag but Facebook vomits if the og:url line even exists.

Here is the code I currently have and everything except the conditional for the og:url tag is working:

function wpc_fb_opengraph() {
$wpc_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
?>
<?php echo "\n<!-- Start of OG Tags from DougTheme 2013 -->\n"; ?>
<meta property="og:image" content="<?php if (function_exists('catch_that_image')) {echo catch_that_image(); }?>" />
<meta property="fb:admins" content="XXXXX"/>
<meta property="fb:app_id" content="XXXXXXXXXX">
<meta property="og:site_name" content="<?php bloginfo('name'); ?>" />
<meta property="og:description" content="<?php if ( is_singular() ) { echo strip_tags(get_the_excerpt()); } else { echo "comments about everything"; } ?>" />
<meta property="og:title" content="<?php if ( is_singular()) { echo esc_attr( get_the_title() ); } elseif (function_exists('is_tag') && is_tag()) {single_tag_title('Tag Archive for "'); echo '" - '; echo get_bloginfo('name');} else { echo get_bloginfo('name'); } ?>">
<meta property="og:type" content="<?php if ( is_singular() ) { echo "article"; } else { echo "website";} ?>">
if (is_home()) {
<meta property="og:url" content="<?php bloginfo('url'); ?>" />
<?php } //end if home

elseif ( is_tag() ) {
<meta property="og:url" content="<?php echo $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; ?>">
<?php }

<?php echo "\n<!-- End of OG Tags from DougTheme 2013 -->\n"; ?>
<?php }

add_action('wp_head', 'wpc_fb_opengraph');

How do I include the test inside the function?


po2368016 on "Javascript get_posts"

$
0
0

Is it possible to use the get_posts method in a javascript block?
If yes, then how am I going to do it? Can anyone give me examples or links to get ideas.

xtkdx on "Correct way of creating a plugin table"

$
0
0

Hi, I hope this is the correct forum for this.

I am starting to create a plugin, and this plugin will be adding two tables in the wordpress database, but some users say that I should not be doing it this way and that its incorrect... they state to use meta tables or something... I tried searching google for a quick example of how to use them but I really cant find anything so I was wondering if anyone can show me an example comparing a regular table to using wp meta instead....

hopefully I get some help from someone here... Thanks

michaelkay on "Plugin version number not changing"

$
0
0

I have updated my plugin and followed the steps to tag a version but the version on the Wordpress Plugins site is not updating. The Stable tag in the trunk/readme.txt clearly shows to new tag but the 'current' version still shows 1.0 (it should be 1.2 now). Any ideas?

Here is the plugin

Here is the readme in in Trac.

Diogo15 on "Set global $posts after query_posts()"

$
0
0

Where do i get an Array with all the posts queried after use query_posts()?

Or how do I reSet "global $posts" after "query_posts()"

Thanks, Luis.

e7traf-host on "remove all img tags from post_content"

$
0
0

i have a big wordpress installation more than 200K post

all i need to do is remove all <img> tags from posts content.

completly removing from my posts not only striping from show.

any ideas!

Viewing all 8245 articles
Browse latest View live




Latest Images