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

lykkelille on "Change my "If password required" function. STUCK!"

$
0
0

I am desperately trying to change this message: "There is no excerpt because this is a protected post" on the index page into showing the actual password form, WITHOUT having to click into the actual post.

Have been trying for a loong time now, but i seem to do something wrong as as soon as i change something, my whole wordpress page turns blank.

This is what i have:

if ( post_password_required() ) {
return __( 'There is no excerpt because this is a protected post.' );
}

return apply_filters( 'get_the_excerpt', $post->post_excerpt );
}

And i want this text to turn into SHOWING THE PASSWORD FORM.

Been trying for 2 days now. I am totally stuck :(


warner8720 on "Changer woo-commerce product search url"

hashtagnofilter on "Adding shoppable products to BLOG, not commerce site!"

$
0
0

Hey everyone,

This is my first time posting on here so I really hope that there is a sharp mind out there with far beyond my understanding that can offer me some insight.

I'd like to feature shoppable items on my blog, like if I have a beauty/fashion post then I'd like to be able to feature the mentioned products to the bottom of the post and link to where visitors can buy them from.

You can check out this post on The Coveteur to better understand what I'm describing since I'm probably sucking at it right now: http://www.thecoveteur.com/selfie-beauty/

I'm assuming that I'd have to add some post functions to do this... Does anyone know the easiest way to go about it or some codes that I can mess around with?

Now what would also be wonderful is if the featured products across my Wordpress site can be all called on one separate page, so there is one go-to place to check them out. The Coveteur's Shop resembles this: http://www.thecoveteur.com/shop/

As you can see, all the products link to outside websites/stores. I don't want an eCommerce site, I just want to be able to highlight products on my blog.

If anyone knows how to go about any of this, your input would be increeeedibly appreciated! Much gratitude in advance xx

selnomeria on "text is not put in tags ( in VISUAL editor, after clicking ENTER)"

$
0
0

hi.
i have installed some plugins,
but now, when in VISUAL EDITOR (or even HTML),
after clicking enter, and then switching to HTML, there are no <p> or tagsa,and also, the published content is everything in one line,without <p> tags... (but in VISUAL editor i have many new lines...)
why it happened?

(only TInymce-Advanced otpion, to check Stop removing the <p> and <br /> tags when saving and show them in the HTML editor helps.. but i dont want that plugin, as everything worked normally at first..)

PetruTiglar on "Help adding field to search filter"

$
0
0

Not quite sure where to post this, If someone could direct me in the right place it would be much appreciated.

I'm currently working on a Property Listing website for Australia.
the functions that came with the theme we're using needs some modifications and I'm trying to find Help.

At the moment there is only 1 drop down that contains all the suburbs in Australia. and I'd simply want to create a new field that you first need to select the state and then select the suburb within that state and then search.

Im not sure how to go about this,

I'd also like to add a Property search bar to the home page.
If anyone can help me out here it would be much appreciated.

http://petfriendlyrentalproperties.com.au/

Thanks

javawpscript on "How to have a different favicon for each page"

$
0
0

What i would like is to have specific favion's on each page. I have currently got All in one favicon installed.

Contortion on "How to get category slug or ID in core functions.php"

$
0
0

How can i get the category slug in core functions.php for use in the function wp_upload_dir()?

I have tried all the following without success

//$uploadcat =  get_the_category_by_ID(2); // works but need to find how to get ID
	//$subdir = '/' . $id;
	//$subdir = '/' . get_query_var('cat');
	//$subdir = '/' . $post->ID;
	//$subdir = '/' . $cat_ID;
	//$subdir = '/' . get_the_ID();
	//$subdir = '/' . the_ID();
	//$subdir = '/' . get_the_category(); returns array, empty?
	//$subdir = '/' . the_category();

tasko on "wp_editor Link Question"

$
0
0

Hello,
Is it possible to hide/remove the "Or link to existing content" section from tinyMCE (link button)?


sesin on "Someone Hacked My Web Site"

rikay on "Help needed: Adding YouTube parameters to oEmbed function"

$
0
0

Hi there,

I want to add these youtube parameters ?rel=0&?wmode=transparent&iv_load_policy=3&showinfo=0&vq=hd1080 to the youtube iframe that is created with the oembed function. For Example: pasting a youtube link (http://www.youtube.com/watch?v=-McFIAlP0Ow) inside a post will now only result in this:

<iframe width="100%" height="394" src="http://www.youtube.com/embed/-McFIAlP0Ow?feature=oembed" frameborder="0" allowfullscreen="" style="height: 420px;"></iframe>

I want the oembed function to automatically add the earlier mentioned parameters, so the iframe will look like this:

<iframe width="100%" height="394" src="http://www.youtube.com/embed/-McFIAlP0Ow?feature=oembed?rel=0&?wmode=transparent&iv_load_policy=3&showinfo=0&vq=hd1080" frameborder="0" allowfullscreen="" style="height: 420px;"></iframe>

I know i can add these parameters manually by adding them to the iframe html code provided by youtube. But i have a lot of bloggers and want to make it as simple as possible for them to create youtube posts. So rather then let them use the youtube iframe code i want them to just paste the youtube link inside the posts and let oembed do all the work for them.

I already know the oembed functions are located in wp-includes/class-oembed.php, but my lack of javascript and php skills stops me from randomly adding coding to this file.

I really hope someone can provide me with the right piece of php coding or javascript!

Thanks and Merry Christmas to all of you!

Madern on "Searching for mod sections of entry"

$
0
0

Hi!
I'm searching for mod or something like that, which allows me to create a sections of each entry. I mean something like on:
http://www.moddb.com/games/feud/news
where each game/mod had a download section/image sections/download section etc.

Can anybody help me ?
:)

5ngua on "Simple custom login plugin"

$
0
0

Hi there,

First of all, sorry for my bad WP plugin knowledge. I just want to create a simple custom login following this guide because I do not want to add the code whenever the theme is updated. This is the first time I try to create a WP plugin. I already created a file called plugin.php with it's header. And I do not know what to do next.
Could you tell me what code I have to add to plugin.php to make it work like described in the codex document?

Many thanks,

efromm on "HELP! Custom URL image"

efromm on "HELP! Custom URL image"

$
0
0

I purchased a Theme that has a custom section where it suppose that I must just upload images of my clients and the theme does the rest: ( it's very easy to add client, just go to 'Clients--> Add New'. Just type the URL and upload your client logo)

The point is that where I upload an image doesn't show and when I look into the console I can see how doesnt exist any reference to a image link. <img src="" alt="client 1">

The client section has a .php code:

<?php
?>
<!-- OUR CLIENTS -->
	<div class="container clearfix">
		<div class="sixteen columns m-bot-20">
			<ul class="our-clients-container clearfix">
        		    <?php
                    $count = 1;
        		    $type = 'client';
        		    $args=array(
        		    'post_type' => $type,
                    'posts_per_page' => -1
        		    );
        		    query_posts($args);	?>	

					<?php if (have_posts()) : while (have_posts()) : the_post();
						$clienturl = get_post_meta($post->ID, 'iweb_client_link', TRUE);
						$thumb_w = '188';
						$thumb_h = '80';
						$client_img = rwmb_meta( 'iweb_client_img', 'type=plupload_image' );
						foreach ( $client_img as $image )
						{
							$client_img = $image['full_url'];
							$client_img = aq_resize($client_img, $thumb_w, $thumb_h, true);
						}
                    ?>

				<li class="">
					<a href="<?php echo $clienturl; ?>">
						<div class="bw-wrapper">
							<img src="<?php echo $client_img; ?>" alt="<?php the_title(); ?>" />
						</div>
					</a>
				</li>
				<?php endwhile; ?>

			<?php endif; wp_reset_query(); ?>
			</ul>
		</div>
	</div>

maybe some master can help me to edit something so I can upload image and set up the file url. Would be perfect if I can use my stored images in cloud, like AWS S3 service.

Thanks in advance

kskerp on "WordPress Menu Question"

$
0
0

Happy Holidays!

I have been using the Namaste! LMS plugin to build an e-learning course, but have found out that due to how the plugin is written, assignments cannot be added to the WordPress Menu (they require a unique student_id and lesson_id for the URL which changes user to user).

I am trying to create an addition in both the Namaste! LMS plugin and where the WordPress Menu is created/generated in order to fulfill my need.

I have been searching around trying to find the php file where the WordPress Menu is being called. Could someone point me in the correct direction? I believe it is located in:
intranet_wp/wp_admin/includes/nav-menu.php

I also am having trouble determining which function/method is actually creating the new menu items. I am specifically concerned with where the "Link" menu item is written. This item prompts the admin for a "URL" and a "Link Text" to generate the menu item.

If anyone could tell me where to find the snippet of code that is taking care of this, I would be greatly appreciative!

Thanks for your time.

- Kevin


sventje on "hack or virus?"

$
0
0

I got a mail from a friend asking me why he is receiving emails from our site through the contact page.
He send me one of them and yes those are spam.

the thing is that I have a captcha installed, and this honeypot plugin to the contactpage.
The contactpage is in 4 languages.

Since he had send me the mail I have changed the contacpage and gave it a new core name.

Seems he keeps receiving the mails. Actually in his primary language.
An important detail is that the man's email adress is not in any way added to the list of receivers in the contactform's setings

Someome got suggestion?

I'm using contactform 7, simple captcha and honeypot

Thanks

chaos67731 on "Make multiple pages and set template/content on theme activation?"

$
0
0

OK, I have two different code and I need them mixed together more or less.

I want to be able to make 5 or 6 pages on a site when my theme is activated.

When it makes the pages, I want it to set the template that that page will use and set content to that page.

Here is code I have that will just make more than one page.

function create_initial_pages() {
    $pages = array(
        'page1' => 'Page 1',
        'page2' => 'Page 2',
        'page3' => 'Page 3',
        'page4' => 'Page 4'
    );
    foreach($pages as $page_url => $page_title) {
        $id = get_page_by_title($page_title);
        $page = array(
            'post_type'   => 'page',
            'post_name'   => $page_url,
            'post_title'  => $page_title,
            'post_status' => 'publish',
            'post_author' => 1,
            'post_parent' => ''
        );
        if (!isset($id)) wp_insert_post($page);
    };
}

Here is code that will make only one page but set the content and template that page should have.

if (isset($_GET['activated']) && is_admin()){
        $new_page_title = 'Sitemap';
        $new_page_content = ' ';
        $new_page_template = 'sitemap.php'; //ex. template-custom.php. Leave blank if you don't want a custom page template.
        //don't change the code bellow, unless you know what you're doing
        $page_check = get_page_by_title($new_page_title);
        $new_page = array(
                'post_type' => 'page',
                'post_title' => $new_page_title,
                'post_content' => $new_page_content,
                'post_status' => 'publish',
                'post_author' => 1,
        );
        if(!isset($page_check->ID)){
                $new_page_id = wp_insert_post($new_page);
                if(!empty($new_page_template)){
                        update_post_meta($new_page_id, '_wp_page_template', $new_page_template);
                }
        }
}

Thanks

JoseSegue on "Double underlined words in posts that are mouse-over ads"

$
0
0

My posts are getting too many words that are orange and double underlined, and when moused over show an ad. They appear whether I publish via IE or Chrome. These "ad words" don't appear in "previews," and I don't see a plug-in that would be doing this. Norton Antivirus, and securi.net's scan found nothing. How can I get rid of these? You should see the words "videos," "Scott" and "Maybelline" highlighted on this page.

Sascha_77 on "Bigger description field in Nextgen Gallery Uploader? Solution is here. :)"

$
0
0

Hi folx.

I figured out how to expand (and word-wrap) the very tiny description filed in the nextgen gallery uploader.

Open the file:
wp-content/plugins/nextgen-public-uploader/npu-upload.php

Find the Line:

$strOutput .= "\n\t<input type=\"textarea\" name=\"" . esc_attr( $name ) . "\" id=\"" . esc_attr( $name ) . "\"/>";

and replace it with this:

$strOutput .= "\n\t<textarea type=\"textarea\" style=\"height:150px;width:680px\" name=\"" . esc_attr( $name ) . "\" id=\"" . esc_attr( $name ) . "\"/></textarea>";

Now you have a resizable Text Field. :D You can change or add styles within "style" to your needs. For my needs height and width is enough.

http://s7.directupload.net/images/131227/2oqa6cwl.png

SpidermanPuddin on "Custom Select Query doubles posts"

$
0
0

Custom Select query will SOMETIMES double the post. Meaning it'll display the same post twice, consecutively. It only does it on certain term ids. Here's the query

$querystr = "
			SELECT COUNT(ID)
			FROM $wpdb->posts
			LEFT JOIN $wpdb->postmeta AS date_value
				ON($wpdb->posts.ID = date_value.post_id
				AND date_value.meta_key = 'date_value')
	  		INNER JOIN  $wpdb->term_relationships
	              ON (wp_posts.ID = $wpdb->term_relationships.object_id)
	  		INNER JOIN  $wpdb->term_taxonomy
	              ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
	        INNER JOIN  $wpdb->terms
	              ON ($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id)
			WHERE $wpdb->posts.post_status = 'publish'
				AND $wpdb->posts.post_type = 'custom_post'
				AND date_value.meta_value >= '" . date('Ymd') . "'
				AND $wpdb->terms.term_id IN ( $term->term_id )
	";
	$result = mysql_query($querystr) or die(mysql_error());
	// Print out result
	while($row = mysql_fetch_array($result)){
		$gs_count = $row['COUNT(ID)'];
	}
	unset($querystr);

I've only been able to fix this by deleting the post(s) and republishing them.

Viewing all 8245 articles
Browse latest View live




Latest Images