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

kennydowuk on "[woocommerce] customizing messages by product category"

$
0
0

trying to detect a product category when the user adds an item to the cart in woocommerce. So that they get a different 'added to cart' message depending on the product they add

the idea is that if they add a picture from the gallery it points them towards mounting services, but if they add a mounting service it gives the standard message

this is the code i have so far it just skips the category filter and runs the standard message.

function wc_add_to_cart_message( $product_id) {
	if ( is_array( $product_id ) ) {

$categories = get_the_category( $id);

		$titles = array();

		foreach ( $product_id as $id ) {
			$titles[] = get_the_title( $id );
		}

		$added_text = sprintf( __( 'Added "%s" to your cart.', 'woocommerce' ), join( __( '" and "', 'woocommerce' ), array_filter( array_merge( array( join( '", "', array_slice( $titles, 0, -1 ) ) ), array_slice( $titles, -1 ) ) ) ) );

	} else {
		<if($categories == 'gallery') {
			$added_text = sprintf(__( '"%s" add a mount' );
		}else{
			$added_text = sprintf( __( '"%s" was successfully added to your cart.', 'woocommerce' ), get_the_title( $product_id ) );
	}
	}

sijithskumar on "Facebook like code-no button"

$
0
0

I have an image that I created on my website. When people click on that image, I want it to open my FB page and "like" it. I do not need a FB "like button". My button is in the footer and I require a code that I can paste on the footer.php to link it to my image. Is this possible? Any help in this matter is highly appreciated.

franclin on "how to modify recent posts in a short code to include offset"

$
0
0

I have a theme that is missing the 'offset' argument within it's 'recent_posts' function. I have found the script and I need to edit but I'm not sure where to add the 'offset=1'

*note this is part of a short code. When implemented in the post it looks like this:
[recent_posts columns="1" number_posts="1" cat_id="news" exclude_cats="" thumbnail="yes" title="yes" meta="yes" excerpt="yes" excerpt_words="15" strip_html="yes"][/recent_posts]

I would like to add
offset="1"

Here is the code specific to recent_posts found within the shortcode.php page.

//////////////////////////////////////////////////////////////////
// Recent Posts
//////////////////////////////////////////////////////////////////
add_shortcode('recent_posts', 'shortcode_recent_posts');
function shortcode_recent_posts($atts, $content = null) {
	global $data;

	wp_enqueue_script( 'jquery.flexslider' );

	extract(shortcode_atts(array(
		'layout' => 'default',
		'columns' => 1,
		'number_posts' => 4,
		'exclude_cats' =>  ''

	), $atts));

	if(!isset($atts['columns'])) {
		$atts['columns'] = 3;
	}

	if(!isset($atts['excerpt_words'])) {
		$atts['excerpt_words'] = 15;
	}

	if(!isset($atts['number_posts'])) {
		$atts['number_posts'] = 3;
	}

	if(!isset($atts['strip_html'])) {
		$atts['strip_html'] = 'true';
	}

	if($atts['strip_html'] == 'yes') {
		$atts['strip_html'] = 'true';
	} elseif($atts['strip_html'] == 'no') {
		$atts['strip_html'] = 'false';
	}

// if ther is no category id, check if there is a category name or slug //
	if(!empty($atts['cat_id']) && $atts['cat_id']){
		$query_atts['category_name'] = $atts['cat_id'];
	} elseif(!empty($atts['cat_slug']) && $atts['cat_slug']){
		$query_atts['category_name'] = $atts['cat_slug'];
	}
	$query_atts['posts_per_page'] = $atts['number_posts'];

	if($exclude_cats) {
		$cats_to_exclude = explode(',', $exclude_cats);
		foreach($cats_to_exclude as $cat_to_exclude) {
			$idObj = get_category_by_slug($cat_to_exclude);
			if($idObj) {
				$cats_id_to_exclude[] = $idObj->term_id;
			}
		}
		if($cats_id_to_exclude) {
			$query_atts['category__not_in'] = $cats_id_to_exclude;
		}
	}

//the start of the loop
	$recent_posts = new WP_Query($query_atts);
	if($layout == 'default'):
		$attachment = '';
		$html = '<div class="avada-container">';
		$html .= '<section class="columns columns-'.$atts['columns'].'" style="width:100%">';
		$html .= '<div class="holder">';
		$count = 1;
		while($recent_posts->have_posts()): $recent_posts->the_post();
		$html .= '<article class="col">';
		if($atts['thumbnail'] == "yes"):
		if($data['legacy_posts_slideshow']):
		$args = array(
		    'post_type' => 'attachment',
		    'numberposts' => $data['posts_slideshow_number']-1,
		    'post_status' => null,
		    'post_mime_type' => 'image',
		    'post_parent' => get_the_ID(),
			'orderby' => 'menu_order',
			'order' => 'ASC',
			'exclude' => get_post_thumbnail_id()
		);
		$attachments = get_posts($args);
		if($attachments || has_post_thumbnail() || get_post_meta(get_the_ID(), 'pyre_video', true)):
		$html .= '<div class="flexslider floated-post-slideshow">';
			$html .= '<ul class="slides">';
				if(get_post_meta(get_the_ID(), 'pyre_video', true)):
				$html .= '<li class="full-video">';
					$html .= get_post_meta(get_the_ID(), 'pyre_video', true);
				$html .= '</li>';
				endif;
				if(has_post_thumbnail()):
				$attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'recent-posts');
				$full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
				$attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id());
				$html .= '<li>
					<a href="'.get_permalink(get_the_ID()).'" rel=""><img src="'.$attachment_image[0].'" alt="'.get_the_title().'" /></a>
				</li>';
				endif;
				if($data['posts_slideshow']):
				foreach($attachments as $attachment):
				$attachment_image = wp_get_attachment_image_src($attachment->ID, 'recent-posts');
				$full_image = wp_get_attachment_image_src($attachment->ID, 'full');
				$attachment_data = wp_get_attachment_metadata($attachment->ID);
				$html .= '<li>
					<a href="'.get_permalink(get_the_ID()).'" rel=""><img src="'. $attachment_image[0].'" alt="'.$attachment->post_title.'" /></a>
				</li>';
				endforeach;
				endif;
			$html .= '</ul>
		</div>';
		endif;
		else:
		if(has_post_thumbnail() || get_post_meta(get_the_ID(), 'pyre_video', true)):
		$html .= '<div class="flexslider floated-post-slideshow">';
			$html .= '<ul class="slides">';
				if(get_post_meta(get_the_ID(), 'pyre_video', true)):
				$html .= '<li class="full-video">';
					$html .= get_post_meta(get_the_ID(), 'pyre_video', true);
				$html .= '</li>';
				endif;
				if(has_post_thumbnail()):
				$attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'recent-posts');
				$full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
				$attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id());
				$html .= '<li>
					<a href="'.get_permalink(get_the_ID()).'" rel=""><img src="'.$attachment_image[0].'" alt="'.get_the_title().'" /></a>
				</li>';
				endif;
				if($data['posts_slideshow']):
				$i = 2;
				while($i <= $data['posts_slideshow_number']):
				$attachment_new_id = kd_mfi_get_featured_image_id('featured-image-'.$i, 'post');
				if($attachment_new_id):
				$attachment_image = wp_get_attachment_image_src($attachment_new_id, 'recent-posts');
				$full_image = wp_get_attachment_image_src($attachment_new_id, 'full');
				$attachment_data = wp_get_attachment_metadata($attachment_new_id);
				$html .= '<li>
					<a href="'.get_permalink(get_the_ID()).'" rel=""><img src="'. $attachment_image[0].'" alt="" /></a>
				</li>';
				endif; $i++; endwhile;
				endif;
			$html .= '</ul>
		</div>';
		endif;
		endif;
		endif;
		if($atts['title'] == "yes"):
		$html .= '<h4><a href="'.get_permalink(get_the_ID()).'">'.get_the_title().'</a></h4>';
		endif;
		if($atts['meta'] == "yes"):
		$html .= '<ul class="meta">';
		$html .= '<li><em class="date">'.get_the_time($data['date_format'], get_the_ID()).'</em></li>';
		if(get_comments_number(get_the_ID()) >= 1):
		$html .= '<li><a href="'.get_permalink(get_the_ID()).'">'.get_comments_number(get_the_ID()).' '.__('Comments', 'Avada').'</a></li>';
		endif;
		$html .= '</ul>';
		endif;
		if($atts['excerpt'] == "yes"):
		$stripped_content = tf_content( $atts['excerpt_words'], $atts['strip_html'] );
		$html .= '<p>'.$stripped_content.'</p>';
		endif;
		$html .= '</article>';
		$count++;
		endwhile;
		$html .= '</div>';
		$html .= '</section>';
		$html .= '</div>';
	elseif($layout == 'thumbnails-on-side'):
		$attachment = '';
		$html = '<div class="avada-container layout-'.$layout.' layout-columns-'.$columns.'">';
		$html .= '<section class="columns columns-'.$atts['columns'].'" style="width:100%">';
		$html .= '<div class="holder">';
		$count = 1;
		while($recent_posts->have_posts()): $recent_posts->the_post();
		$html .= '<article class="col clearfix">';
		if($atts['thumbnail'] == "yes"):
		if($data['legacy_posts_slideshow']):
		$args = array(
		    'post_type' => 'attachment',
		    'numberposts' => $data['posts_slideshow_number']-1,
		    'post_status' => null,
		    'post_mime_type' => 'image',
		    'post_parent' => get_the_ID(),
			'orderby' => 'menu_order',
			'order' => 'ASC',
			'exclude' => get_post_thumbnail_id()
		);
		$attachments = get_posts($args);
		if($attachments || has_post_thumbnail() || get_post_meta(get_the_ID(), 'pyre_video', true)):
		$html .= '<div class="flexslider floated-post-slideshow">';
			$html .= '<ul class="slides">';
				if(get_post_meta(get_the_ID(), 'pyre_video', true)):
				$html .= '<li class="full-video">';
					$html .= get_post_meta(get_the_ID(), 'pyre_video', true);
				$html .= '</li>';
				endif;
				if(has_post_thumbnail()):
				$attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'portfolio-two');
				$full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
				$attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id());
				$html .= '<li>
					<a href="'.get_permalink(get_the_ID()).'" rel=""><img src="'.$attachment_image[0].'" alt="'.get_the_title().'" /></a>
				</li>';
				endif;
				if($data['posts_slideshow']):
				foreach($attachments as $attachment):
				$attachment_image = wp_get_attachment_image_src($attachment->ID, 'portfolio-two');
				$full_image = wp_get_attachment_image_src($attachment->ID, 'full');
				$attachment_data = wp_get_attachment_metadata($attachment->ID);
				$html .= '<li>
					<a href="'.get_permalink(get_the_ID()).'" rel=""><img src="'. $attachment_image[0].'" alt="'.$attachment->post_title.'" /></a>
				</li>';
				endforeach;
				endif;
			$html .= '</ul>
		</div>';
		endif;
		else:
		if(has_post_thumbnail() || get_post_meta(get_the_ID(), 'pyre_video', true)):
		$html .= '<div class="flexslider floated-post-slideshow">';
			$html .= '<ul class="slides">';
				if(get_post_meta(get_the_ID(), 'pyre_video', true)):
				$html .= '<li class="full-video">';
					$html .= get_post_meta(get_the_ID(), 'pyre_video', true);
				$html .= '</li>';
				endif;
				if(has_post_thumbnail()):
				$attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'portfolio-two');
				$full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
				$attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id());
				$html .= '<li>
					<a href="'.get_permalink(get_the_ID()).'" rel=""><img src="'.$attachment_image[0].'" alt="'.get_the_title().'" /></a>
				</li>';
				endif;
				if($data['posts_slideshow']):
				$i = 2;
				while($i <= $data['posts_slideshow_number']):
				$attachment_new_id = kd_mfi_get_featured_image_id('featured-image-'.$i, 'post');
				if($attachment_new_id):
				$attachment_image = wp_get_attachment_image_src($attachment_new_id, 'portfolio-two');
				$full_image = wp_get_attachment_image_src($attachment_new_id, 'full');
				$attachment_data = wp_get_attachment_metadata($attachment_new_id);
				$html .= '<li>
					<a href="'.get_permalink(get_the_ID()).'" rel=""><img src="'. $attachment_image[0].'" alt="" /></a>
				</li>';
				endif; $i++; endwhile;
				endif;
			$html .= '</ul>
		</div>';
		endif;
		endif;
		endif;
		$html .= '<div class="recent-posts-content">';
		if($atts['title'] == "yes"):
		$html .= '<h4><a href="'.get_permalink(get_the_ID()).'">'.get_the_title().'</a></h4>';
		endif;
		if($atts['meta'] == "yes"):
		$html .= '<ul class="meta">';
		$html .= '<li>'.get_the_time($data['date_format'], get_the_ID()).'</li>';
		if(get_comments_number(get_the_ID()) >= 1):
		$html .= '<li><a href="'.get_permalink(get_the_ID()).'">'.get_comments_number(get_the_ID()).' '.__('Comments', 'Avada').'</a></li>';
		endif;
		$html .= '</ul>';
		endif;
		if($atts['excerpt'] == "yes"):
		$stripped_content = tf_content( $atts['excerpt_words'], $atts['strip_html'] );
		$html .= $stripped_content;
		endif;
		$html .= '</div>';
		$html .= '</article>';
		$count++;
		endwhile;
		$html .= '</div>';
		$html .= '</section>';
		$html .= '</div>';
	elseif($layout == 'date-on-side'):
		$attachment = '';
		$html = '<div class="avada-container layout-'.$layout.' layout-columns-'.$columns.'">';
		$html .= '<section class="columns columns-'.$atts['columns'].'" style="width:100%">';
		$html .= '<div class="holder">';
		$count = 1;
		while($recent_posts->have_posts()): $recent_posts->the_post();
		$html .= '<article class="col clearfix">';
		$html .= '<div class="date-and-formats">
			<div class="date-box">
				<span class="date">'.get_the_time('j').'</span>
				<span class="month-year">'.get_the_time('m, Y').'</span>
			</div>';
			$html .= '<div class="format-box">';
				switch(get_post_format()) {
					case 'gallery':
						$format_class = 'camera-retro';
						break;
					case 'link':
						$format_class = 'link';
						break;
					case 'image':
						$format_class = 'picture';
						break;
					case 'quote':
						$format_class = 'quote-left';
						break;
					case 'video':
						$format_class = 'film';
						break;
					case 'audio':
						$format_class = 'headphones';
						break;
					case 'chat':
						$format_class = 'comments-alt';
						break;
					default:
						$format_class = 'book';
						break;
				}
				$html .= '<i class="icon-'.$format_class.'"></i>
			</div>
		</div>';
		$html .= '<div class="recent-posts-content">';
		if($atts['title'] == "yes"):
		$html .= '<h4><a href="'.get_permalink(get_the_ID()).'">'.get_the_title().'</a></h4>';
		endif;
		if($atts['meta'] == "yes"):
		$html .= '<ul class="meta">';
		$html .= '<li>'.get_the_time($data['date_format'], get_the_ID()).'</li>';
		if(get_comments_number(get_the_ID()) >= 1):
		$html .= '<li><a href="'.get_permalink(get_the_ID()).'">'.get_comments_number(get_the_ID()).' '.__('Comments', 'Avada').'</a></li>';
		endif;
		$html .= '</ul>';
		endif;
		if($atts['excerpt'] == "yes"):
		$stripped_content = tf_content( $atts['excerpt_words'], $atts['strip_html'] );
		$html .= $stripped_content;
		endif;
		$html .= '</div>';
		$html .= '</article>';
		$count++;
		endwhile;
		$html .= '</div>';
		$html .= '</section>';
		$html .= '</div>';
	endif;

	return $html;
}

TokyoS on "Help with QTRANSLATE plugin"

$
0
0

Hi,

I'm doing a website made with WordPress 3.8.1 and the theme "ResponsivePortfolioDessign" which has 2 languages: English and Spanish
here: adriaginger.com

As you can see, Qtranslate has allowed me to translate everything except the Main-Logo, the Footer, and the line "My Last Shortfilms".

How can I do to have a different logo and footer depending the language selected ("en" or "es")?

Here some code regarding Logo (header.php):

<header id="header">
	<div class="container">
		<div class="logo_cont">

<?php if(get_option($shortname.'_custom_logo_url','') != "") { ?>
				<a href="<?php bloginfo('url'); ?>"><img src="<?php echo get_option($shortname.'_custom_logo_url',''); ?>" class="logo" alt="logo" /></a>
			<?php } else { ?>
				<a href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/logo.png" class="logo" alt="logo" /></a>
			<?php } ?>		

		</div><!--//logo_cont-->

And here some code regarding Footer (footer.php):

<?php $shortname = "design_studio"; ?>
<div class="footer_copyright_cont">
<div class="footer_copyright">
	<div class="container">
		<?php echo stripslashes(stripslashes(get_option($shortname.'_copyright_text',''))); ?>
		<div class="clear"></div>
	</div><!--//container-->
</div><!--//footer_copyright-->
</div><!--//footer_copyright_cont-->
<?php wp_footer(); ?>
</body>
</html>

Thanks!! :)

rwpackett on "Syntax Error"

$
0
0

Updated plugins and ended up with a spam I think...

Got this error message

Parse error: syntax error, unexpected T_FUNCTION in /hermes/bosnaweb04a/b2652/glo.packreif/wp-content/plugins/custom-sidebars/inc/class-custom-sidebars.php on line 97

Any idea how I can get back in and fix this?

Thanks in advance

virtous on "WYSIWYG behavior and text processing"

$
0
0

Hey all!

I'm trying to change the way that the rich text editor processes posts.
If I write the following inside the visual tab:

Hi,

This is a paragraph.
And this is a line break inside the paragraph.

This is a new paragraph.

A few things come to notice.
First of all, if I inspect the rich editor I can see that each line is in its own paragraph, like below:

<p>Hi,</p>
<p>&nbsp</p>
<p>This is a post.</p>
<p>And this is a line break in the same paragraph.</p>
<p>&nbsp</p>
<p>This is a new paragraph.</p>

Also, if I head over to the HTML/text tab, I see this:

Hi,

&nbsp 

This is a post.

And this is a line break in the same paragraph.

&nbsp 

This is a new paragraph.

Finally, if I look on the actual blog page itself. It has trimmed all the white lines and wrapped each sentence in a paragraph tag:

<p>Hi,</p>
<p>&nbsp</p>
<p>This is a post.</p>
<p>And this is a line break in the same paragraph.</p>
<p>&nbsp</p>
<p>This is a new paragraph.</p>

I have to use the wpautop() function to get the same result on the blog page as inside the wysiwyg editor.

However this is not the issue here. The thing I would like to know is where and how I can change the way that WordPress processes post content before it gets inserted to the database.

Any help is appreciated :-)

Virt

little_anarchist on "jQuery Plug-in not working in wordPress"

$
0
0

I am trying to use this jQuery plug-in on a wordPress site:
http://www.backslash.gr/content/blog/webdevelopment/9-contenthover-jquery-plugin

I have created a non-wordPress test page. The plug-in works fine on this test page:
http://www.webslingers.ca/wp-content/themes/spaceman/content-hover.html

When I try to use it within a wordPress page it doesn't work:
http://www.webslingers.ca/content-hover-test/

I have tried loading the scripts in a variety of different ways (in the footer, header, noConflict etc.) with no success. I see that there are other posts where users are having this difficulty with WordPress and JQuery. None of them have helped me so far. What am I doing wrong?

pushbroom on "posting a html banner in my blog"

$
0
0

I posted a html banner, like I have always done in wordpress, but the banner don't show up. I used and around it in text mode. Please help.


flogen on "Make post title sit on top of featured image?"

$
0
0

Hey.

I just installed the Editor responsive theme, which I'm happy with overall.

The one issue I have is that the featured images sit on top of a post, followed by the date and author, followed by the post title.

The effect is to make all the elements look separate to each other, rather than part of the one post. (You can see what I mean here).

I'm wondering is there an easy way for me to change this - ideally to put the post title on top of the relevant featured image?

Thanks in advance.

johansenkristian on "Plugin or inspiration for toggle javascript"

$
0
0

Hello.

I'm looking for a plugin or if someone in here has any experience with implementing the effect when you scroll down the page the headline and the info text changes. I have looked in the source and it doesn't look like they are using a CMS system but I want to implement this in wordpress so the title refers to the title in the backend and the content to the content and text to the either a custom field or content text.

http://www.designbolaget.dk/

I hope you understand my question and can help me..

Thanks!

Pete on "How to only display something if the post's gallery has more than 1 image"

$
0
0

I'm looking for a snippet of code (looked and googled everywhere) that will only display something/anything/html etc if the gallery attached to a post has more than 1 image.

Thanks heaps

Love Pete

bagui on "Impossible d'afficher Datepicker Events Manager"

PJCJonas on "Custom client side media uploads and editing"

$
0
0

Hi, I have a registration form that includes an image upload as well. Now the image uploading works 100%, its when I try to "edit image" in the backend where things break. Images that are uploaded via the client facing side, when I edit them and crop them smaller, and save it the file name changes but the image is broken and can not be found. However images uploaded from the backend directly into the media section, when cropped work 100%. Here is my client side image uploading PHP:

$file_array = array(
					'name' 		=> $_FILES['file']['name'],
					'type'		=> $_FILES['file']['type'],
					'tmp_name'	=> $_FILES['file']['tmp_name'],
					'error'		=> $_FILES['file']['error'],
					'size'		=> $_FILES['file']['size']
				);

				if ( !empty( $file_array['name'] ) ) {

					$uploaded_file = wp_handle_upload( $file_array, $upload_overrides );
					$wp_filetype = wp_check_filetype( basename( $uploaded_file['file'] ), NULL );

					$wp_upload_dir = wp_upload_dir();

					// set up the array of arguments for "wp_insert_post();"
					$attachment = array(

						'guid' => $wp_upload_dir['url'] . '/' . basename( $uploaded_file['file'] ),
						'post_mime_type' => $wp_filetype['type'],
						'post_title' => preg_replace('/\.[^.]+$/', '', basename($uploaded_file['file'])),
						'post_content' => '',
						'post_status' => 'inherit'

					);

					$attachment_id = wp_insert_attachment( $attachment, $wp_upload_dir['subdir'] . '/' . $file_array['name'] ,$attach_post_id);

					// generate the attachment metadata
					$attach_data = wp_generate_attachment_metadata( $attachment_id, $uploaded_file['file'] );

					wp_update_attachment_metadata( $attachment_id,  $attach_data );
					set_post_thumbnail( $attach_post_id, $attachment_id );
				}

ysm-design on "customise search"

$
0
0

Hi.
I made a kind of search box, that my search have 4 Dropdown field with some categorise.

my code:

<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
<?php wp_dropdown_categories( 'hide_empty=0&child_of=3&show_option_all=Kind' ); ?>
<?php wp_dropdown_categories( 'hide_empty=0&child_of=22&show_option_all=Value' ); ?>
<?php wp_dropdown_categories( 'hide_empty=0&child_of=54&show_option_all=Weight' ); ?>
<?php wp_dropdown_categories( 'hide_empty=0&child_of=65&show_option_all=width' ); ?>
<input type="submit" id="searchsubmit" value="Search" />
</form>

when a user select 4 field, and then Click on Search, my search form work very well and show the result good,
But when the user select 3 or 2 or 1 field, my form do not work well and dont show the result.

what can i do?

mojonek on "Changing the Purchase Button - Woocommerce"

$
0
0

I have to hide the possibility to buy for not logged in users (whole domain or store)

Ex:
If a user is NOT logged in (don't have an account) then the cart button etc will not show. Sees only a link "See store locator list".

Only if user logged in will they show prices and button "Buy" and they will have the opportunity to purchase.

example code
if(is_user_logged_in()

if(is_user_NOT_logged_in()
Show "See store locator list" with page URL.

How to do it?
Please could someone help?


rickykpg on "Making feature image clickable in post."

$
0
0

Hello,

My theme automatically adds the featured image into the post. I'm trying to make it so the feature image is clickable to show the full image but so far I've had no luck. I have been able to make it so the image is click-able but it just reloads the post.

I initially posted this in the plugins & hacks section before reading the pinned thread about this section.

Here's the code for the feature image with my changes.

<?php echo ‘<a target=”” href=”‘.get_permalink().’”>’.get_the_post_thumbnail( get_the_ID(), ‘homepage-wide’ ).’</a>’; ?>

Any help would be greatly appreciated.

mlarino on "woocommerce product page redirect to wp pages"

$
0
0

Hi
I am going to use Woocommerce to create a product catalog, but instead of using woocommerce product pages, i want to redirect those to a standard wp page where I can design each one completely different.

Is there a way to overwrite the product pages URLs to go to a WP Page?

My first idea is using htaccess but I am not sure if there are other ways to do this, without htaccess.

the idea is:
-Clicking on a product normally takes you to:
http://www.xxxx.com/shop/product_name

I would like them to go to:
http://www.xxxx.com/page/product_name

So instead of using the product page layout of woocommerce, it would direct you to a page I created in WP.

any ideas?
thanks!

Darnok017 on "Loop problem"

$
0
0

Hi,

Maybe i'm writting in wrong topic (sorry for that), but i did't know where :)
I have a problem with posts.
I used

<?php query_posts('category_name=Bez kategorii'); ?>

<div id="primary">
  <div iv="content" role="main">

<?php if ( have_posts() ) : ?>

				<?php forever_content_nav( 'nav-above' ); ?>

				<?php

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

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

				<?php endwhile; ?>

				<?php forever_content_nav( 'nav-below' ); ?>

<?php endif; ?>

			</div><!-- #content -->
		</div><!-- #primary -->

And in every page i see the same 5 posts. Where is the problem?

Thanks for help!

mikhak on "Ho I can redirect not found page to search reaslt ?"

valeriedore on "Want to give access to edit a particular post to particular role"

$
0
0

Hi,

How to prevent a user to edit a particular post? I need to use functions.php and not a plugin. Plugin is not working in my case :

If I activated : edit_others_posts, to give access to edit post in the "WYSIWYG Widgets" (https://wordpress.org/plugins/wysiwyg-widgets/), the Author role can change all the "posts" there.

Thanks,
Valerie

Viewing all 8245 articles
Browse latest View live




Latest Images