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

graffo on "Adding button to post edit screen"

$
0
0

Hi Everyone

I'm have 3 custom fields maded with advanced custom field and i need put a button to send those custom fields informations to an email.

How i proceed?


mrjhon01 on "How to automatically add one link after each image in all posts on my blog?"

$
0
0

I think in blog.php where you can edit the blog post to have an active link.

just find this for instance, that,

<img > // Where this is the image you want to have an active link

then, wrap using the and should be like this

<img>

and add the attribute to the a, for instance

Jack Holloway on "How to automatically add one link after each image in all posts on my blog?"

$
0
0

Hi! My blog contains about 1000 images, each article features about 10 images. I'd like to add an active one link (www.google.com for instance) after each image. I mean, only one link on the whole blog, in all posts. In which file it can be done and how?

Thank you! Hope you can help me out.

tanzimhm on "Redirect My website from mobile"

$
0
0

My website which is redirects to others unknown websites from mobile.

How to i fixed this problem.
please help me any one.

my website is http://www.todaytimes24.com

same problem also in subdomains : bangla.todaytimes24.com

DaveA2015 on "Looking for a plugin to convert review percentage into grade letter"

$
0
0

I'm converting my site over to WP. We have many reviews that are all based on letter grade. I like the percentage system in WP but I'm wondering if there's a plugin/hack to convert the overall score into a letter grade. So it would change the 75% into a C.

Thanks for any help.

wozner on "Shoes, bags and other .html adverts"

$
0
0

Hello everyone.

I am facing a lot of hacks these days with WordPress websites (any version), domains are filled with .html scam files, adverts of nike shoes, DC bags, watches. For example:

000-nike-airmax-ladies.html
001-converse-highcut-snlp.html
001-rakuten-adidas-sneakers-men.html
001-studded-converse.html
002-adidas-stance.html
003-converse-snelkers-bllck.html
003-nb-574-list-price.html
003-nb-gray-navy.html

Files everywhere, in the root of domain, in wp-admin,wp-includes,wp-content folders. Checked Httpd logs, FTP logs, nothing suspicious. Maybe someone faced the same issue? Please share your experience.

With all respect
Wozner

amhicks00 on "Newbie needs to edit .html"

$
0
0

I need to be able to add the code to make a captcha appear on my contact form pages. I can see from examples on my Comments pages WHERE it goes by viewing the source code for the page, but I can't copy/paste the code from there. I also can't figure out how to see ALL of the background code for a page when I go to EDIT the page and ADD the code. I can only see the 'visual' and 'text' versions of my page, and adding the code there does no good. All of your answers in the forum explain things in terms I don't have the background knowledge to understand. HOW do I see and edit ALL of the background code for a page? I am using 'big brother' theme. Please use the simplest terms possible for someone who can learn, but has little experience!
Thanks in advance for your patience with me! Basically, I want the captcha code seen here: http://ipdpl.org/ask-a-librarian/ on the lower, Comment section of the window to apply instead to the upper, email section of the page so that my primary user doesn't get 500 spam messages a day!

gavinr on "Widget Admin - Form Submit Event?"


wavemose on "Remove the "continue reading" from theme code php"

$
0
0

<div class="post-readmore">
<?php
$readmore_text = get_theme_mod( 'themedsgn_customizer_readmore', "Continue reading..." );
?>
" title="<?php the_title_attribute(); ?>"><?php echo ! empty( $readmore_text ) ? $readmore_text : 'Continue reading...'; ?>
</div>

Hello, It looks like this is the code for the"continue reading" that comes up on the content page. I don't want the reader to have to make that selection. Just show the content without "continue reading.... ", which requires an extra click of the mouse for the reader. And it also prevents a photo from showing up until the "continue reading.. is clicked. What should I do? Remove the entire "read more" as posted in the code above or replace it with some other code or what??? Please help me!

Thank you!

Dave

oneruffryder on "Image uploader inside custom post widget"

$
0
0

I'v built a custom widget that will show some sport scores. Scores are added trough custom post. When i open new custom post(scores) i enter their team names, score, scores. Now i want to add an option to show team logos next to the team name. In the last couple of days every tutorial here and elsewhere i could find didnt worked. I have no idea why, as i am newbie with all this. With many of it, upload button appears but the pop up to chose/upload image doesnt appear. Now I could post at least 10 links where i found this codes but i believe there is a limit with link. So for an example this is most common tutorial i have found.

`<label for="upload_image">
<input id="upload_image" type="text" size="36" name="ad_image" value="http://" />
<input id="upload_image_button" class="button" type="button" value="Upload Image" />

Enter a URL or upload an image
</label>

<?php
add_action('admin_enqueue_scripts', 'my_admin_scripts');

function my_admin_scripts() {
if (isset($_GET['page']) && $_GET['page'] == 'my_plugin_page') {
wp_enqueue_media();
wp_register_script('my-admin-js', WP_PLUGIN_URL.'/my-plugin/my-admin.js', array('jquery'));
wp_enqueue_script('my-admin-js');
}
}

?>

<script>
jQuery(document).ready(function($){

var custom_uploader;

$('#upload_image_button').click(function(e) {

e.preventDefault();

//If the uploader object has already been created, reopen the dialog
if (custom_uploader) {
custom_uploader.open();
return;
}

//Extend the wp.media object
custom_uploader = wp.media.frames.file_frame = wp.media({
title: 'Choose Image',
button: {
text: 'Choose Image'
},
multiple: true
});

//When a file is selected, grab the URL and set it as the text field's value
custom_uploader.on('select', function() {
console.log(custom_uploader.state().get('selection').toJSON());
attachment = custom_uploader.state().get('selection').first().toJSON();
$('#upload_image').val(attachment.url);
});

//Open the uploader dialog
custom_uploader.open();

});

});
</script>

what exactly is this 'my_plugin_page' i guess i am doing something wrong and that's why uploader doesnt pop up. What i need to add instead of it, any example?

Inside my theme i'v made a new folder called my-plugin inside which i added my-admin.js with the script code from the link above. Is this the right way?

I also tried other way without it and calling the script by get_template_directory_uri().

Any help pls.

amybill1978 on "delete_user_meta function with wp_clear_auth_cookie?"

$
0
0

So I have a little hack I made to add the user's PHPSESSID to the wp_usermeta table when a user logs in (which is working perfectly). I've been trying for several hours to delete the same info when a user logs out, and can't seem to get the dang thing to work. I'm wondering now if the wp user object isn't available anymore after you click logout? I read elsewhere that I should be able to use wp_clear_auth_cookie(), but no luck there either. Any insights would be great.

function create_session_id($user_login){

    if(!session_id()) {
            	session_start();
		$user_obj = get_user_by('login', $user_login );
		$user_id = $user_obj->ID;
		$session_id = session_id();
		add_user_meta( $user_id, 'session_id', $session_id);
	}else{
		$user_obj = get_user_by('login', $user_login );
		$user_id = $user_obj->ID;
		$session_id = session_id();
		add_user_meta( $user_id, 'session_id', $session_id);
	}
}
add_action('wp_login', 'create_session_id');

function delete_session_id(){

		$current_user = wp_get_current_user();
		$user_id = $current_user->ID;
		delete_user_meta( $user_id, 'session_id', '');
}
add_action('wp_clear_auth_cookie()', 'delete_session_id');

kevleitch on "Header image and screemnshot not working"

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?

mintmind on "How to exclude tags have less than x number of posts from the_tags()?"

$
0
0

When I use the_tags() to get the links of tags of the article, I want to exclude or don't show some tags which only have 1 or 2 posts.
How can I set a minimum number of posts to show?

umsuka on "adding custom field to display 5 flickr images"

$
0
0

Hi All

I am a newbie in development and I need assistance with displaying flickr albums on posts. The client wants to use flickr album to embed at least 5 images into the website.

A custom field will have to be used to have the flickr info added and cahnged at anytime. I downloaded and installed Meta Boxes. I can see the custom fields displaying on the post page. I have a problem now displaying it on the front end of the website.

Thanks


et3rnal on "Duplication function"

$
0
0

Hi,

I used this duplication function
http://rudrastyh.com/wordpress/duplicate-post.html
to achieve the ability to duplicate post from the front-end.

The modification I did doesn't seems to be the right way to integrate such a thing in WordPress

This is what I did:-
-Change the function so it accepts one parameter rd_duplicate_post_as_draft($post_id)
-Remove the checking for the post/get etc if (! ( isse....
-Remove the redirect code (stopped working!/error)
-Add return new post id (didn't help)
-Removed the second function which add the duplicate link to wp-admin

Then in the page template I want to add the button/link I added the same stuff from the original function at first which checks the posts/gets values if ( isset( $_GET['post']) || .....
then I call the function in function.php
$new_post_id = rd_duplicate_post_as_draft($post_id);

The duplication link reload the same page + passing the 2 arguments

Issues:-
I cant redirect to the new duplicated page (header already set...)
The parameters stays on the address bar which means refreshing = new duplication!

What is the right way to integrate duplication function on the frontend?

JuniorPilot on "Wich Password Algorithm"

$
0
0

Hi everyone,

at the moment i am totaly lost.

I have an external Application, which should using the Wordpress user login's.

My problem is now, that i do not now, in which way wordpress is calculates the password algorithm.

For me it is looks like für md5 with salt. Is it right?
And who can i use it for my ohne application?

Thanks in advance..
Martin

luarb on "Post Hit Counter - show hit counter for not loggedin visitors"

$
0
0

Hi ,

I want to display the hit counter for normal visitors
how can i do that ?

umsuka on "Meta Box Front end Display"

$
0
0

Hi All

I am having problems displaying my custom fields on the front end of the website.

Any help please.

vtinath on "Adding theme support for post formats - I get some errors"

$
0
0

Hi,
I've been trying to get wordpress to offer me the option between "standard" and "link" posts.

I'm using my own custom theme, not based on any default one.

I managed to get it working in my category template using advice from this thread. Yay.

But, in order to be able to select a post format in the admin panel, as I understand, I also need to add

<?php add_theme_support( 'post-formats', array( 'standard', 'link' ) ); ?>

to functions.php.

This works, BUT, with errors. It shows me the option to select between "link" and "standard" formats, but when I save the post, I get this error:

Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/2015/functions.php:3) in /home/public_html/wp-admin/post.php on line 237

Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/wp-content/themes/2015/functions.php:3) in /home/public_html/wp-includes/pluggable.php on line 1196

The post gets saved correctly in spite of the error, but it is annoying to keep getting it on every content update.

Is there something else I need to do to get this working right?
I have read about post formats and adding theme support in the codex but I'm none the wiser.

Here's my functions.php:
http://pastebin.com/yrXZUqKD

Any help appreciated!

Viewing all 8245 articles
Browse latest View live


Latest Images