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

alex84636 on "Display specific search results depending on the wp page being used."

$
0
0

I am customising search page results for staff and customers.

I have created a private page, password protected, hidden to the public, and I want more information to display when staff use the search in this page.

If the public are using the search, on the non private page, I want to show less information.

My thoughts where if the page or page template is 'stock-managers', then display this, else then display that.

I have tried various approaches, and cant seem to get anything to work. Any help would be really appreciated.

<?php if (is_page('stock-managers')) { ?>

	<article class="entry post clearfix">
        <-- Title / Thumbnail / Price / Description coding -->
	</article>

<?php } else { ?>

	<article class="entry post clearfix">
        <-- Title / Thumbnail / Description coding -->
	</article>

<?php } endif; ?>

mesotu on "Combine/mix WP themes"

$
0
0

Hi all,
I'd like to use the following blocked blog style (from Smart Mag them) on my Avada theme.

The style I like is here: http://theme-sphere.com/smart-mag/category/creative/

I currently have a blog style like this (which I don't like): http://theme-fusion.com/avada/blog-2/

I guess I'm wondering which files I'd need to move to my Avada directory to get this to work. Probably have to find the PHP file that makes this page and the associated CSS

I'm also thinking there might be conflicts between the themes and I'd have to do some renaming of the CSS etc.

Thanks in advance.

Bloodofeve on "Gettext Filter issue"

$
0
0

I have tried to use 'Gettext-filter-Wordpress' for a eCommerce site I am building, the issue is my client wants two text strings swapped around, I read through the instructions and added the code Which is show below, but I received the following error:

Fatal error: Cannot redeclare my_text_strings() (previously declared in /homepages/24/d520177130/htdocs/.pomegranate/wp-content/themes/canvas-child/functions.php:70) in /homepages/24/d520177130/htdocs/.pomegranate/wp-content/themes/canvas-child/functions.php on line 91

The code I used is as follows:-

/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Related Products' :
$translated_text = __( 'You may also like...', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );
/**
* Change text strings
*
* @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext
*/
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'You may also Like...' :
$translated_text = __( 'Related Products', 'woocommerce' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );

Am I missing something here, and did I need to install a plugin? I am not a programmer so this is a little beyound my normal work area.

ShortwaveWebSolutions on "Using i0.wp.com theme screenshots from plugin"

$
0
0

I am writing a plugin which I will submit to wordpress.org when it's finished. It's a tool to make theme admin easier for web devs like myself.

Part of the requirements is that I need to display thumbnails and full size images of a variety of themes available on wordpress.org

One solution to this is using the images available on i0.wp.com e.g.
https://i0.wp.com/themes.svn.wordpress.org/tdpersona/1.5.1/screenshot.png

The nice thing about them is the ?w=x prefix would allow me to show thumbs or full size images depending on what's required e.g. https://i0.wp.com/themes.svn.wordpress.org/tdpersona/1.5.1/screenshot.png?w=100

My question is, would it be frowned up to link to these images from my plugin? I just wondered if there would be issues with using the i0.wp.com bandwidth.

It's not for commercial gain as the plugin will be free, and the amount of downloads will be a drop in the ocean to i0.wp.com but I thought I had better check... is anyone reading this in a position to give me the go ahead?

smatias on "Tabindex registration form"

$
0
0

Hello everyone, I am trying to change the tabindex from the registration form on wordpress. Does anyone one where that code lives specifically the "first name, last name and password fields"?

Thank you very much!!

thymotep on "Can I override a theme file from my plugin?"

$
0
0

Hello everyone :)

After a search time, without finding a solution, I just wonder if it is possible, from a plugin, edit a theme file?

I created a plugin that improves adding comments, I add new fields with no problem, but I would also like to customize the display (comments.php in theme).

During my research, I came across this article ( http://stackoverflow.com/questions/4647604/wp-use-file-in-plugin-directory-as-custom-page-template ), but here is not, I do not seek to create a page template, but to overload a theme file from my plugin.

I do not even know if this is possible, but thank you in advance for your help.
Thymotep

m_pahlevanzadeh on "a post with two links"

$
0
0

Dear All,

goolge webmaster tools alerts me my post has two link, and google told me it's duplicate content, As you knowm duplicte content has nagetive score, How can i remove one of them ?

cyberlp23 on "Add username after "Welcome" on the dashboard"

$
0
0

Hello,
How can I add the first name of the user after the welcome message widget on the admin dashboard: "Welcome to Wordpress [user first name] !".
Thanks!


cyberlp23 on "Prevent posting when no category is selected"

$
0
0

Hello,

I'm trying to trigger an action if, when a user tries to publish a post, no category is selected:
- It could either be just an alert message (and the post is still published);
- Or actually alter message + preventing the post from being published.

Searching on this forum, I've found the code:

jQuery('#submitdiv').on('click','#publish',function(e){
            var $checked = jQuery('#category-all li input:checked');
            if ( $checked.length <= 0 ) { //Checks if cat is selected
            alert("Please Select atleast one category");
            return false;
            }else{ //Else continue
                return true;
            }
            });

But I have no idea where to put it.

Thanks!

Ati74 on "Problem with pagination_links"

$
0
0

Hello again,

i use in my Plugin-Backend some Custom Tables and i want to paginate them with paginate_links.
Now i have three "little" Problems. Under my table exist the Paginationlinks but...
1.) If click on Page 2 it shows me the Datasets correctly, but i cant go back to Page 1.
Page 1 is not marked as a link!!!
2.) If i am on Page 3 and click on "Next" it goes to Page 2. The same if i am on Page 6 e.g.
3.) The Paginationlinks are 123..6 Next. If i am on Page 3 i dont see 4 or 5

Here is my (terrible) Code

function mitarbeiter_loeschen() {
	global $wpdb;
	$table_lagerma = $wpdb->prefix . "za_lagerma";
	// Wurde das Formular abgeschickt dann entsprechend löschen
	if (isset ( $_REQUEST ["do"] ) && $_REQUEST ["do"] == "loeschen") {
		$loeschma = $_POST ['maid'];

		foreach ( $loeschma as $loeschid ) {
			$wpdb->query ( $wpdb->prepare ( "DELETE from $table_lagerma where id = %d", $loeschid ) );
		}
	}
	echo '<p><div class="wrap">';
	echo '<h2>Mitarbeiter loeschen!!!</h2>';
	echo 'Hier werden Mitarbeiter geloescht</p>';
	echo '<hr>';

	$per_page = 6;
	$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
	$page = intval ( $_GET ['paged'] );
	$total_pages = ceil ( $wpdb->get_var ( "SELECT COUNT(*) FROM $table_lagerma" ) / $per_page );
	$sql = $wpdb->prepare ( "SELECT * FROM $table_lagerma ORDER BY nname ASC LIMIT %d, %d", max ( $page - 1, 0 ) * $per_page, $per_page );
	$mitarbeiter = $wpdb->get_results ( $sql );
	echo '<form name="mitarbeiter_loeschen" method="post" action="">';
	echo '<h4> Angelegte Mitarbeiter<h4>';
	echo '<table><tr><td></td><td>Vorname</td><td>Nachname</td><td>Logistik</td></tr>';
	foreach ( $mitarbeiter as $ma ) {
		echo '<tr><td><input type="checkbox" name="maid[]" value="' . $ma->id . '"></td>';
		echo '<td>' . $ma->vname . '</td>';
		echo '<td>' . $ma->nname . '</td>';
		echo '<td>' . $ma->logistik . '</td></tr>';
	}
	echo '</table><input type="submit" id="buttonloeschen" value="Loeschen" onclick="return confirm(\'Wirklich loeschen?\');" />';
	echo '<input name="do" type="hidden" id="check" value="loeschen"></form></div></p>';
	$big = 999999999; // dummy
	echo '<p>';
	$paginate_links = paginate_links ( array (
			'base' => @add_query_arg('paged','%#%'),
			'format' => '?paged=%#%',
			//'current' => max( 1, $paged),
			'current' => max( 1, get_query_var('paged') ),
			'total' => $total_pages
	) );
	echo $paginate_links;

	echo '</p>';
}

Kettercat on "Sort order of display?"

$
0
0

Hey everyone,

I have a page that shows a gallery of related articles:
http://uv-tlv.com/article-category/%D7%A8%D7%90%D7%99%D7%95%D7%A0%D7%95%D7%AA-%D7%A9%D7%A7%D7%99%D7%99%D7%9E%D7%AA%D7%99/
I want the articles to appear by order of date - newest article on top. Right now it doesn't show that way.

Here's the page template code:

<?php get_header(); ?>
<div id="content" class="clearfix row-fluid articles">
<br>

<?php echo term_description() ?>

	<?php while (have_posts()) : the_post(); ?>
        <article id="post-<?php the_ID(); ?>" class="list_katavot">
			<?php the_post_thumbnail('thumbnail'); ?>
            <h4 style="display: none">
            	<a href="<?php the_permalink() ?>" target="_blank">
                	<?php the_title(); ?>
                </a>
                </h4>
        </article>
		<?php endwhile; ?>

</div>

<?php get_footer(); ?>

Any idea? :)
Thanks!

lakong on "dynamical URL after Contact Form 7 submission"

$
0
0

On this page:

http://iq.newofferings.com/accounts-payable-outsourcing-datasheet/

I send the user to a PDF upon submission (feel free to fill in the form, it's just a test server). I use:

on_sent_ok: "location = 'http://iq.newofferings.com/wp-content/uploads/2015/04/IQDatasheet_AccountsPayable1.pdf';"

In the additional settings dialogue box in CF7. However, I have several WP pages that essentially use the same form, but each needs to send the user to a different PDF URL.

How can I change the location URL dynamically. If I can simply substitute the page slug, I can easily change the names of each PDF. So for example, I can change:

http://iq.newofferings.com/wp-content/uploads/2015/04/IQDatasheet_AccountsPayable1.pdf

to:

http://iq.newofferings.com/wp-content/uploads/2015/04/accounts-payable-outsourcing-datasheet.pdf

Any suggestions would be greatly appreciated!

jscamposcr on "Is there a ways to overwrite core functions through a plugin"

$
0
0

Hi Everyone!

I'm wondering if there is a way to overwrite the hashing function that wordpress uses for passwords to something more secure like a sha2 + salt but doing it in such a way that WordPress updates wont delete my progress.

Let me know and thanks for your help!

rapunzel on "Image mouseover/click to main image"

$
0
0

After hours upon hours of trying to find a plugin that would change my WooCommerce featured (or main) image to one of the thumbnails after it's clicked on.

I found this script at dynamic drive but I cannot get it to work and I'm not familiar with WooCommerce scripting. Can someone help me figure out how to implement this script into the WooCommerce product image page?

The first demo on the dynamic drive script is what I want to happen with my product images. Except instead of hovering over the thumbnail and having it change the main photo. I want the user to click the thumbnail and then have it change the main image. No pop up lightboxes or going directly to the image link. All I want is the thumbnails to show up in the main image.

Another example of what I'm looking for is like Magic Thumb, but they expect you to pay and all I want is the thumbnail change. I don't want any of the other bells and whistles.

skarbona on "Speed up widgets back-end page and debug it"

$
0
0

I have problem with very slow loading widget back-end page. And i have script error on load(every-time).
I know it is problem with too many active widgets.
Any idea how to hide/dont load all widgets on page open? Maybe load widgets on click on widget-area?


richard.coffee on "Show unattached images in media loader via javascript/filter"

$
0
0

I would like to be able to only show unattached images when calling the media loader via javascript. Here is how I am currently setting it up:

var custom_uploader = wp.media({
    title: 'Assign/Upload Listing Image',
    library: { type: 'image' },
    button: { text: 'Assign Image' },
    multiple: false
  });

I had thought maybe I could use the 'media_view_settings' filter, but have been unable to get that to work. I thought I might be able to use something like post_parent=>0, but no joy.

Any help, or just a nudge in the right direction, would be greatly appreciated.

Wayn on "display related post by taxonomy"

$
0
0

Hi Guys

I want to show related posts, with the same taxonomy (artists) as the current post. In the realted post I dot want the current post to appear.

I am also using a custom post type. (sculptures)

This is the code i am using below, but it is showing the current post in the realted post and all post not only those with the taxonomy (artists")

Does anyone have a solution

<div class="related-posts">
<h3 class="widget-title">Related Posts</h3>

</div>

CallumHill on "Extending the Search"

$
0
0

Hello,

After filtering through so many articles on the subject, am I correct in thinking that this is all I need to do to extend the search function with a custom input? I feel as though I'm missing something completely.

I'm very new to this more advanced side of Wordpress and any help would be appreciated.

I have a form in a widget, passing to the Search function which I'm looking to add in to the current search.

global $_GET;
global $wp_query;

function showsearcher()
{
	$show_cat = $_GET['show_category'];
	$find_cat = new WP_Query( 'category_name=$show_cat' );
	$query->set($find_cat);
}

add_action('pre_get_posts','showsearcher');

jscamposcr on "How to run script after WP update"

$
0
0

Hi Everyone!

I'm looking for a way to call a script every time that WP goes through an autoupdate.

Let me know of any ideas.

simonhead on "Href Tags in Extended Profile"

$
0
0

Hi
I have searched for days to this solution and I am reaching out to you fine folks!!

I am trying to create download links within the users profile so that the user can download their files [in this case a zipped file]. I created a multi lined text field within the extended profile part of the users profile [backend] I then tried to add href tags to the field.. It kind of works but href tags won't work so I just put the path to the file instead.. This looks ugly and Href tags would be a better looking solution..

So my main question: Is there a better way to do this?
It must be known that all users must only be able to see their own files within their profiles.
I appreciate all your help!!

Viewing all 8245 articles
Browse latest View live




Latest Images