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

Zuige on "Regexing the final output"

$
0
0

Is there a way of somehow processing the final wordpress page output with for example regex, including both the template and the post ? Perhaps a filter hook I could use? Couldn't seem to find one very easily.

Also, could someone direct me somewhere that would explain how exactly wordpress prints a page?

Thanks!


dgissen on "Jquery Masonry bricks not appearing/loading"

$
0
0

Hi Everyone:

I am trying to use jquery masonry on the home page of this test site

Much of what I am implementing is based on principles in Morten Rand-Hendrikson's tutorial on jquery masony. I just copied the function with a few modifications.

As you can see, the masonry script enqueues, but the itemSelector .photo-entry is not being transformed into a "masonry brick". I can't tell if the problem is with the function.php, home.php, or the style sheet. funtion.php and home.php are below.

function anaximander_masonry() {
	if (!is_admin()) {
		wp_register_script('jquery_masonry', get_template_directory_uri(). '/js/jquery.masonry.min.js', array('jquery'), '2.0.110526' );
		wp_enqueue_script('jquery_masonry');
		add_action('wp_footer', 'anaximander_add_masonry');

		function anaximander_add_masonry() { ?>
			<script>
				jQuery(document).ready(function($){
					$('#masonry-index').masonry({
						itemSelector: '.photo-entry',
						isAnimated: true
					});
			  	});
			</script>
		<?php
		}
	}
}

add_action('init', 'anaximander_masonry');
<?php get_header(); ?>

<div id="primary" class="site-content">
<div id="content" role="main">

	<!-- Begin loop for latest photos -->
	<?php if ( have_posts() ) : ?>
<section id="masonry-index" class="group">
		<?php while ( have_posts() ) : the_post(); ?>
		<div class="photo-entry">

			<a href="<?php the_permalink(); ?>">
			<?php the_post_thumbnail(); ?>

			<footer>
				<h2><?php the_title(); ?></h2>
				<p class="date"><?php the_time('m.d.Y'); ?></p>
			</footer>
			</a>

		</div>
		<?php endwhile; ?>
</section><!-- #masonry-index -->
	<?php else : ?>

		<!-- Message if there are no photos -->
		<p><?php _e( 'Please check back soon for more photos!', 'twentytwelve' ); ?></p>

	<?php endif; ?>
	<!-- End loop -->

	<!-- Navigation for older and newer posts -->
	<nav class="photo-navigation">

		<p class="previous-photos">
			<?php next_posts_link('‹ Older posts ');  ?>
		</p>
		<p class="newer-photos">
			<?php previous_posts_link('Newer posts ›');  ?>
		</p>

	</nav>

</div>
</div>

<?php get_footer(); ?>

ps. I'm using a childtheme

MrSmoke on "Allowing @ in slugs"

$
0
0

Im building a new wordpress website/theme and I would like to do something similar to what joystiq does by having Categories (News, Reviews, Tutorials), Special tags (PC, Xbox, Linux etc) and normal tags (bf3, Christmas etc).

Im doing the special tags by prefixing the tag slug with a '@' and then checking the tag's slug in the theme and showing the ones with the @ in a different location (under the category like on Joystiq) and excluding them from the main tags list (though this means I have to write my own 'the_tags' type function.

Is there a nicer way to do this?
How can I allow @ in the tag slugs without having to edit them in the db?

dogdayfear on "Bulk edit image Captions"

$
0
0

Hi all:

Is there any way tocreate a hack to bulk edit image captions when inserting a gallery?

Im showing a catalogue. Caption shows the size and price of the clothe. There are a lot of clothes with the same size and price, so I need to bulk edit captions for selected images.

Thanks for your ideas in advance.

dazzlesoftware on "plugin only works after I change priority"

$
0
0

Hello I seem to have issue well in my plugin it setup post types via config array which is attached via filter

add_action( 'init', 'headlines_register_post_type');
function headlines_register_post_type()
{
	$post_types = apply_filters( 'headlines_post_types', array() );
	foreach ( $post_types as $post_type )
	{
		new Headlines_Post_Type( $post_type );
	}
}

but as soon as I call my class function for

add_action( 'init', array( $this, 'register_post_type' ) );

it stops working but if I change the priory for

add_action( 'init', 'headlines_register_post_type', 5);

it works how can I use the default priory ? as I sure this is not good way to code plugins changing the priory as it could conflict other plugins maybe ...

Stephen

matt.milan on "in my widget, shortcode $variable parameter not working"

$
0
0

I wrapped a plugin with a widget. i want the widget to tell the plugin what to do by sending the widget $title to the plugin shortcode parameter.

echo do_shortcode('[rotating-posts category_name="blog"]');

works

echo do_shortcode('[rotating-posts category_name="$title"]');

does not.

i tried a few different syntaxes,
_name=$title - nothing happens
_name='$title' - crash

I will post the code in the next comment.

netcom on "3.7.1 security error for SWF Help please"

allm on "youtube embed using shortcode"

$
0
0

I have a page with a shortcode that generates a link to a youtube movie. The link does not turn into an embedded movie.

If I put the youtube link into the page as plain text all is well and I see an embedded movie.

Can anybody tell me why this is so? Is the content of the page first processed for youtube links and only then for shortcodes?

By the way: If I generate the link between [embed]'s the link dissapears and no embedded movie can be seen.


AaronRhoades on "Excerpt ... the loop? recent posts on another page besides the blog page..."

$
0
0

I have a website. http://www.aaronrhoades.com/blog is where it's at right now (will be moving it to http://www.aaronrhoades.com when it's done).

I'm trying to get the little thing on the upper right corner to work. EVERYTHING IS PERFECT... EXCEPT.... the excerpt is from the home page, rather than from each individual post... how do I fix it?

<?php
	$args = array( 'numberposts' => '4' );
	$recent_posts = wp_get_recent_posts( $args );
	foreach( $recent_posts as $recent ){
		echo '<li><h3><a href="' . get_permalink($recent["ID"]) . '" title="Look '.esc_attr($recent["post_title"]).'" >' . $recent["post_title"]. "</a></h3>" . get_the_excerpt() . "</li>" ;
	}
?>

I need them to be list items. I think the problem, lies in "get_the_excerpt" which I had tried using the_excerpt, but that didn't work either. how do i specify where to grab the excerpt? not sure if I'm in the wrong direction.

federod on "Contact Form 7 Checkbox clicked and opens a Textbox bellow it."

$
0
0

Hey guys need some help I was wondering if there is any way that I can in the contact form 7 plugin when the people click on a check-box under it a text-box shows up to add more information to see if it possible

alpharaven on "Posts Attachments"

$
0
0

I am sure some of you out there know the answer to this but I can not find the correct solution. Everything that I try give me the wrong results.

I am trying to show the images that have been inserted into a post and display them in the single.php page. I either get all of the images that are in my wordbress blog or the last two images that were imported. All that works but I only want to show the ones in the particular post.

$args = array(
					'post_parent'    => $post->ID,
					'post_type'      => 'any',
					'post_mime_type' => 'image',
					 'numberposts' => -1,
					'post_status'    =>'any',
				);
				$attachments = get_children($args);
				if ($attachments) {
					foreach ($attachments as $attachment) {
						$img = wp_get_attachment_thumb_url($attachment->ID);
						$link =  chop($img,'-150x150.jpg');
						echo "<ul class='workPic'> <li class='thumbframe'>";
						echo "<div class='thumbnail'>";
						echo "<a href='".$link.".jpg' target='_blank'>";
						echo "<img src='".$img."' alt='read more'/>";
						echo "</a></div></li></ul>";
					}
				}

Please help as I have been struggling with this for days and cant seem to figure out the solution. I think its in the $args array but I am not sure.

Thanks!

gb-plugins on "jQuery ui problem"

$
0
0

Hi,
i'm working on my plugin 'GB Gallery Slider' and i encounter a problem with jquery ui effects,
if i use:
wp_enqueue_script( 'jquery-ui-core' );
wp_enqueue_script( 'jquery-effects-core' );

the effect 'explode' (.hide('explode','',600); line:415) and other ui effects are not working, but if i load '//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js' all the effects are working.

please help me with this issue.

vk011 on "Pagination not working with custom wp_query"

$
0
0

I am trying to make a custom search plugin but pagination does not work (it shows up with the correct number pages but does not function properly).

Relevant part of the search plugin (from the main function.

$blog_url = get_bloginfo('url');

    $form = <<<EOH
    <div id="sbc">
    <form method="get" action="{$blog_url}" id="ss-search">
        <input type="text" value="{$search_text}" name="supers" onblur="if (this.value == '') { this.value = '{$search_text}';}" onfocus=if (this.value == '{$search_text}') { this.value = '';}" />
        {$list}
        <input type="submit" id="sbc-submit" value="Search" />
    </form>
    </div>
EOH;

///////////////////////////////////

    if (isset($_GET['supers'])) {

        global $q;
        // global $q;
        $args = array(
            // 'category__not_in' => 1,
            's' => $_GET['supers']
        );

        $q = new WP_Query($args);

        if ( $q->have_posts() ) {
                echo '<ul>';
            while ( $q->have_posts() ) {
                $q->the_post();
                echo '<li>' . get_the_title() . '</li>';
            }
                echo '</ul>';
                // echo '<br>Posts found :'.$q->found_posts.'<br><br>';
                echo get_pagination_links2();
        } else {
            echo 'no posts found';

        }

        /* Restore original Post Data */
        wp_reset_postdata();
    }

    return $form;

} // end function
$q; // add ability to make it global

pagination function in the functions.php file

function get_pagination_links2() {
    global $q;
    // echo gettype($q);
    echo $q->found_posts;
    $big = 999999999;

    return paginate_links( array(
        'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
        'format' => '?paged=%#%',
        'current' => max( 1, get_query_var('paged') ),
        'total' => $q->max_num_pages,
        'prev_next'    => true
    ) );

}

I DO get pagination links, but they don't work (for example if I click next the URL changes but the results don't).

yougotchoices on "New user registration spamers?"

$
0
0

I allow registered users on my site, and want to keep doing so.
However, I have received too many new users, which doesn't make sense. I have had 32 new users in 4 days. I might want to believe that my blog is a huge success, but I know it isn't that.
My Akismet is up and running. Before I tag any as spam, I want to uderstand what might be going on....

These are a few examples of my new users:

Username: ULGChangexpwm
E-mail: talloptimist2577d6 AT outlook DOT com

Username: ToshaLawrence
E-mail: animatedsinger4xze96 AT outlook DOT com

USername: ClairYLYwzrjx
E-mail: qyzywesowet AT hotmail DOT com

Almost all of the emails are hotmail or outlook. Which also doesnt seam likely as so many people have gmail.

What do I do?

nick_nielsen on "Custom post types, taxonomy in shortcode problems"

$
0
0

I'm trying to make a short code that prints out a glimpse of all the custom post types in a custom taxonomy. As far as I can make out it should work, but it doesn't.
I'm not a programmer and this has been put together trawling the web, forums and the codex.
It could be I've made a spelling mistake or missed a comma - but I can't find the mistake.

function wg_album($wguse){
	extract(shortcode_atts(
		array('use' => 'work'), $wguse));
	$args = array(
  			'post_type'   => 'work_gallery',
			  'tax_query' => array(
					array(
						'taxonomy' => 'use',
						'field' => 'slug',
						'terms' => $wguse
					)
				)
			);
	$workpages = new WP_query($args);
	ob_start(); ?>
		<ul class="work-pages">
	<?php foreach ($workpages as $wpage) { ?>

			<li>
				<a href="<?php echo get_page_link( $wpage->ID ); //the permalink?>">

					<?php echo get_the_post_thumbnail($wpage->ID)//the featured image?>
					<h3><?php echo $wpage -> post_title ; ?></h3>

				<p> <?php echo $wpage -> post_excerpt ; ?></p>
				</a>
			</li>

	<?php } ?>
		</ul>
<?php
	return ob_get_clean();
}

Please help


cdwamina on "Integrate Google QPX Express API with Word Press"

$
0
0

I want to integrate the Google QPX Express API with my word press travel website. Is there any step by step information on how to get this done?
We are a travel agent seeking to build our own website to search and process tickets for our clients online via our website. If any one knows how to accomplish this please forward me the guide..

Christian Foellmann on "Generate a list of all filters and actions in a plugin"

$
0
0

Hi guys,

I am trying to generate documentation for some plugins and want to document all the available filter and action hooks.

Does anyone know of a script I can run on the codebase of a plugin to fetch all apply_filters and do_actions?

ppahppp on "thumbnail url from original image url"

$
0
0

hi guys and girls
i need to get to the url of the thumbnail using the url of the original image. this is basically so when users attach a large image with an image uploader/selector it pops up.
I was hoping not to have to reload the page as the image selector dosn't.
but that wouldnt cause too much issue and the image isnt the featured image.

yezarela on "wordpress 6.71 media uploader"

$
0
0

how to call wordpress 6.71 media uploader, because i wanna integrate it into my upload form....please help me!

Piotr on "Looping posts with content from different database"

$
0
0

Hello,

My problem is a bit complicated, but I'm kind of new to WordPress and I'm still learning PHP, so maybe I can't see the solution yet.

Here's my situation. I'm running a community forum on which I have a news section. I would like to have a CMS that takes posts from that section and displays them on a website just as most blogs do - with categories, tags and so on, and I think it can be achieved with WordPress (actually I'm almost sure it can, but I'm missing some knowledge to figure out how exactly). I've read a lot of tutorials, which gave me some ideas.

To do this, I would have to connect to the forum database and get post data from a table or tables. I tried using wpdb class (new wpdb in my child theme functions, it works great), but is it possible to put this data in a WordPress loop using WP_query? Doing it this way would let me use template tags and give me all the goodness of WordPress (permalinks, search, archives?), the problem is, can the WP_query be used or modified to get certain columns from certain tables in a different database, and treat it as usual post data?

If yes, great, if no, I have a second idea - copying certain forum columns into a separate table in wordpress database and using that data for custom posts. Probably this would be better, but I'm worried about the number of connections to the forum database - is there a way to copy and update this data periodically or when certain tables are updated (like when a new news-topic is published or edited)? Because in the previous case I was hoping that some kind of caching plugin in WordPress would solve it, but here... I'm not so sure.

One thing to note - I'm not thinking about editing these posts in WordPress, I don't need to do anything with them (although some parsing will be needed, but that is next on my "learn how to do it" list, if this works out), I just need a one way connection.

So... this is it. I was hoping more experienced users can give me advice and point me in the right direction - I would be very grateful for that. Thanks for anything you can share.

Viewing all 8245 articles
Browse latest View live




Latest Images