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

AThompsonCO on "How to I get rid of the comment box?"

$
0
0

When I upgraded to the newest version of wordpress all the sudden I get a "leave a reply" box on the bottom of every page.

I went into discussion and un-clicked the allow comments so I am not sure what the next step would be.

Thank you!


theresmorgan on "Random CSS changes on page"

dannydanny on "Customizing Search Results Page"

$
0
0

I would like another search results page and am not sure how to implement this.

I want one search results page that comes up when there is a positive result. That page is perfect right now.

But when there is a negative result (nothing found) I would like a different result to come up. I want to remove the social media icons from my header and the search box from my header to clean up the page.

Who is going to "like" a "no results found" page and also, there is no reason to have two search boxes--one in the header and one in the body of the page.

Any ideas on how to implement this?

RoxyJo on "Would someone be willing to look over my php, please?"

$
0
0

I'm hoping that someone can help me?? I've look everywhere for some guidance on how to hide certain dashboard menu items from everyone except administrators.

I would like the plugin to hide menu dashboard items for everyone but admins, and hide elements of the admin bar for everyone (at least that's what it's supposed to do).

I've finally written a plugin that appears to do this, but since I'm learning php I'm really hoping someone with more experience than me can look the code over and make sure that it's secure and written correctly, please?

I'd really appreciate it , thank you so much!

here is the link to the code:
http://tny.cz/3c0921bd

caioxavier on "Help with category page"

$
0
0

Hey guys, I'm new to WP and PHP so I can't really rely on my hardcoding skills to get what I want, so I need your help. It should be simple:

I have category pages and child categories in some of them. I want to display in the category page, links to the current parents and child categories, so the user can filter the posts.

Imagine we are broswing Category 1, with has 2 child categories. All I want is to display:

Category Title

[All] - [Child 1] - [Child 2]

[the loop]

Only the content and category title would be displayed if there are no child categories.

I'm aware I could do this by making specific page templates, but I want to keep everything lean and dynamic, so my client can change the categories as he pleases.

Thank you guys in advance!

aianta on "How to write a "for" loop"

$
0
0

Hello,
I am working on a little project, basically what I would like to do is create a dynamic about page, which takes all users in a user group and print their biographies, names and a picture in a neat manner. My biggest issue is my unfamiliarity with PHP and the wordpressAPI.

I envision my loop working similarly to the posts loop however I am unsure of how to go about fetching this user data (what functions exist if any to do so, etc.)

Any guidance here would be highly appreciated.

brometheus55 on "Help with WordPress Permalink 301 Redirect via .htaccess"

$
0
0

I am currently attempting to change the permastructure of all of my WordPress posts from:
/%year%/%monthnum%/%postname%/
to just
/%postname%/.

I have already made the change in WordPress and added the following code to my htaccess file to initiate the 301 redirects:

RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(.+)$ http://www.mydomain.com/$3

Now everything is working perfectly except for 1 thing. It has caused all archived date pages, for example http://www.mydomain.com/2013/8/20, to redirect to http://www.mydomain.com/20, which causes 404s.

My question is how do I edit the code to not reflect those archived dates. I imagine it's something fairly simple but i know minimal coding and have already spent hours searching online only to come up short. I'm very surprised as the code I used was given as a common fix. I assume most people didn't either use their calendar widgets, or never noticed this problem who used this method.

Anyway please and thanks for help.

theindiehost on "Embed HTML5 Audio Player"

$
0
0

Ok. So I've been searching high and low and can't seem to find a way to do this. Here's my problem. I have a domain that is pointed to my WP site so I can't use plug-ins. I've tried embedding scripts but that doesn't seem to work in individual pages as it gets changed if I try.

I'm not changing my site just to get a streaming player to work. There's got to be a way to just embed a flipping HTML5 (or any other player) without having to hack the quackin thing. Why is this restricted?

I've read the posts and gone through a ton of sites but nothing can seem to embed without using a plugin. Again, I can't do that because my domain points to my WP site. I can't even chose plungins in my dashboard.

I've gotta think there's an easier way to get this done.

My site is http://www.thefive10.com. I've put some players that pop out but I'd rather have that pop out player just appear in the page itself and not have to pop out.


pieterw3 on "Div around Comment text"

$
0
0

Hello, i would like to have a div around my comment text. the current setup is a <p> around the comment text. i found that i might need to edit the wp_list_comments() but i have not been able to find it. can someone point me to the right file to edit?

my theme is responsive. and my site is http://itsolutionsblog.net i am already using a child theme.

NatESkiN on "creating my own "submitdiv""

$
0
0

Good morning,

I'm trying to create my own meta box "submitdiv" for a new post type. Once hidden the "submitdiv" original pressing edit options are not displayed as if it happened in the original Metabox. Do I have to include some javascript? Do not locate.

I would appreciate it.

A greeting.

s3tech.nabbas on "Need to use my site users to login as a wordpress blog user"

$
0
0

Hi
I am developing a website for my client, the site is running from last 2 years.
Now my client ask me to integrate wordpress blog for him, I have integrated this and created a theme for him.
But now he ask me that when a user on the site is login and visit the blog he should automatically be login on wordpress blog, I am new to wordpress so I am confuse how to do this task. I have also search on internet about the solution but found nothing helpful.
Please if someone help me solving this problem, send me the link or helping material so I can end this problem.
Thanks in advance.

ianhaycox on "wptexturize convert ampersands in SCRIPT tags"

$
0
0

According to the documentation

http://codex.wordpress.org/Function_Reference/wptexturize

wptexturize is meant to skip processing text within various tags like PRE, SCRIPT etc, however it always seems to convert ampersands to #038;

For example,

wptexturize('<XXXscript type="text/javascript"> var x = "Hello & goodbye"; </script>');

correctly returns:
NOTE - I've added spaces for display reasons.

<XXXscript type="text/javascript"> var x = & #8220;Hello & #038; goodbye& #8221;; </script>

With the SCRIPT tag,

wptexturize('<script type="text/javascript"> var x = "Hello & goodbye"; </script>');

<script type="text/javascript"> var x = "Hello & #038; goodbye"; </script>

it correctly ignores the quotes but still convert the ampersand.

This causes a real problem with AJAX requests as any GET parameters are not passed, e.g.

http://xx.com/wp-admin/admin-ajax.php?action=foo&bar=1&foobar=2

gets converted to,

http://xx.com/wp-admin/admin-ajax.php?action=foo&#38; #038;bar=1& #038;foobar=2

Is this expected behaviour ?

If it is then is there a workaround, bar removing the wptexturize filter ?

Thanks.

RippedSpine on "admin CV form field to insert in Post/Page"

$
0
0

Hello!

I hope this is the right place to ask :)

I'm trying to figure out how to create a form field in the admin area of WordPress, where the editor/user can create data concerning for example a Curriculum Vitae, and then insert the data into a Page or Post.

This is the concrete example I'm working with:
An artist's Curriculum Vitae where you can create custom forms for 'education', 'exhibitions', 'grants' etc.

And within each form field, the editor would be able to insert data for 'year', 'exhibition title', 'insitution', 'place' and so on depending on the title of the form.

Would also be nice to have the option to have text-fields for longer texts.

So I'm guessing one would first have to create a user interface for the field forms in the admin area, then have the data input posted to the database, and then write a function to retrieve the data from the tables created. (and I'm thinking of adding that function to a custom page template)....

On my search for solutions I've only come across plugins for contact forms and the like, nothing that would really work directly from the admin area. I'm also a bit conscious that I might be searching with the wrong set of keywords, so if any one of you might know or understand what I'm searching for, please nudge me in the right direction. :)

edit: moved this from the plugins/hacks forum, think this is more accurate...

Devtard on "How to print a message after submitting a comment?"

$
0
0

Hello. I want to print a message after submitting a new comment. Any idea how to do that? (I've tried using comment_post, but it doesn't let me print anything.)

itinchev on "Real UTF-8 Cyrillic characters in permalink"

$
0
0

Hello,

I have the following issue with a blog which uses cyrillic (which is probably also an issue for all non ASCII languages):

The temporary and manually generated permalinks can be very short compared to the ones generated in English because the characters in cyrillic are urlencoded before showing/saving. In this way the data shown in the temporary permalink location and then saved to the database is not for example 'видео'('video' in English) but '%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE' which is very bad for the slug length. In this way I can never put a whole title in the permalink, because it becomes very long. I was searching for a way to hook a filter to urldecode the slug in the process of generation and then place it in the temporary permalink and the database but I couldn't find one. I think, in the best case, the same function should work for all slugs i.e. terms, options, etc. Can you suggest a solution?

Thanks.


WP-Sess on "Changed Query Results Now archive date not working"

$
0
0

I have added a new page Template so that I can display News (news Category) & Blog (everything else) on 2 separate pages. all works fine. The Archive widget to call all bt Category works fine BUT the obe that uses dates (months) displays all blog data ? URL seems to be correct but always displays everything ??

It looks like I need to reset the query var but dont know how ?? any help would be gratefully received.

<?php
$the_page = get_query_var('paged'); //<!-- tell wordpress this is paged
query_posts('cat=-6&order=DSC&posts_per_page=20&paged='.$the_page);?>

<?php while ( have_posts() ) : the_post(); ?>

<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>

whitey Hitchcock on "redirection when click on posts"

$
0
0

Daily post are tied to a menu link title TEST1 on my blog http://www.creativementor.net hosted by EarthLink. Click on the menu item and you will be redirected to jp.codedculture.net. I have redone all the internal links and created a new structure with daily posts under TEST1 page. The problem persists. I'm not a techie but it looks like the redirection comes within trying to see a post not the link associated with TEST1. Take a look at my site and see if you have any good ideas how to rearrange my links to get around the problem. Thanks

skincare1 on "My Google description was hacked"

$
0
0

My Google description of my site, "Dinosaur of Education" was hacked to advertise Viagra, etc. How can I fix this so I can continue to use this site. I am a teacher. This is quite embarrassing.

http://fabiano.magic-city-news.com

mayecreate on "List Archives by Date & Category"

$
0
0

So for YEARS now there has been a need for the ability to list archives by date and category.
The category parameter still hasn't been added to core functionality. *sad face* It seems like I've read tons of posts about how to get the desired results of listing date archives for a specific category.

What I'm looking for is the results of wp_get_archives (the bulleted list of dates that link to the archive for that date) but I want it to be category specific.

Does anyone know of a solution for this? I'm okay with adding stuff to my functions file (as long as you also have instructions on how to add it into my sidebar template) or plugins.

Anything helps! Thanks in advance!

nickniebaum on "Wierd AJAX/session issue - sessions being emptied on ajax call"

$
0
0

Hello,

I have a WP site I am working on that uses AJAX calls to load some view data based on some session data that is set. The problem is, the session data that is set is being emptied after an AJAX call. For example:

  • A user logs in, and session data is set to identify that user
  • The user goes to a dashboard, where he clicks a link which initiates an AJAX call that loads HTML based on that user's ID (which is in the session)
  • The loaded HTML is incorrect because the session data is emptied before the AJAX function is ran
  • Thereafter, if you reload the page you are on, the session data is emptied here as well, so the user will have to log in again, where he will again get logged out if he initiates the AJAX call

You may at first think it's a code issue, but I think not. I developed the site on my local machine running Apache, and everything worked fine. However, after uploading it to a Hostgator subdomain, I started getting this problem.

I've set up a barebones test case for anyone who might know what my problem is, which I'm wanting to say it's some kind of hosting configuration problem of some sort, although I'm not entirely sure, as I've never run into this before. The URL for the test case is at: http://accidentreview.lifthousedesign.com/test-page

This page is a blank page, with a single shortcode (PHP source further down in this post) in the body of the page. It simply empties the session, var_dumps it, then adds data to the session, var_dumps it, then displays a button that initiates an AJAX call. The AJAX call simply var_dumps the session (which will be empty because of this issue, whatever the problem is). Another button is below it, which reloads the page without emptying/adding anything to the session, to illustrate that the AJAX call empties the current session (it overwrites it with the empty session).

Shortcode Source:

<?php
	add_shortcode('session_test','session_test');

	function session_test()
	{
		if(!isset($_GET['dont_set']))
		{
			session_unset();
			echo 'session cleared:';
			var_dump($_SESSION);
			echo '<br />';
			$_SESSION['var_1']='val_1';
			$_SESSION['var_2']='val_2';
			$_SESSION['var_3']=array('arr_val_1','arr_val_2');
			echo 'added values to session:';
			var_dump($_SESSION);
			echo '<br />';
			echo 'session id:';
			var_dump(session_id());
			echo '<br />';
			?>
			<button id="test-session">Send AJAX Call (see console)</button>
			<br />
			<button id="reload-dont-set">Load Page without Setting/Emptying Session</button>
			<script>
				function test_session()
				{
					$.ajax({
						url: '/wp-admin/admin-ajax.php',
						data: {
							action: 'test-fn',
						},
						success: function(data){
							console.log('ajax data:');
							console.log(data);
						}
					});
				}

				function reload_dont_set()
				{
					window.location='/test-page?dont_set';
				}

				$(function(){
					$('#test-session').click(test_session);
					$('#reload-dont-set').click(reload_dont_set);
				});
			</script>
			<?
		}
		else
		{
			echo 'only dumping session (not clearing or setting anything):';
			var_dump($_SESSION);
		}
	}

AJAX source:

<?php
add_action('wp_ajax_test-fn','casea');
add_action('wp_ajax_nopriv_test-fn','caseb');

function casea()
{
	echo 'priv:';
	var_dump($_SESSION);
	echo 'session id:';
	var_dump(session_id());
}

function caseb()
{
	echo 'no priv:';
	var_dump($_SESSION);
	echo 'session id:';
	var_dump(session_id());
}

Anyway, thanks for taking the time to read and please let me know if ya'll can come up with anything I am missing!

Viewing all 8245 articles
Browse latest View live




Latest Images