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

thamaraiselvam on "Where can i find wordpress auto update code flows?"


iamrickyspanish on "is there some hook like "after_get_posts"?"

$
0
0

Sorry, I have no idea if this is the right forum.

My Problem:

I have an array of CPT posts that need to be 'injected' into the main query (the main loop of a CPT archive).

I do that by modifying the posts-field of the global WP_Query Object "$wp_query" directly on the archive template page before the loop gets executed. That (obviously) sucks...

So what I need would be a filter/action-hook that allows me to modify the "posts"-field of "$wp_query" just after the query is done.

The best I could find was the "the_posts"-filter. But this filter affects all queries and not only the one of my CPT archive because it just passes the results of WP_Query ($wp_query->posts) but gives me no access to the whole WP_Query Object.

The "pre_get_posts"-hook provides access to the WP_Query Object. This allows me to restrict my actions to certain post-types etc.

So is there anything like the "pre_get_posts"-hook but fired just AFTER the query is done, providing access to the whole WP_Query object, including it's results?

Thanks.

rblakstad on "Isotope - Filter child categories based on ACF parent category"

$
0
0

Hi,

I want to list child cateogories in my Isotope-filtering. The child categories should be based on the chosen parent category in admin (ACF). Right now it fetches ALL categories there is.

How can I solve this? This is my code so far:

<ul id="filters">
    <a href="#" data-filter="*" class="selected button"><?php _e('Alla'); ?></a>
	<?php
		$terms = get_terms("category");
		$count = count($terms);
		if ( $count > 0 ){
			foreach ( $terms as $term ) {
				echo "<a href='#' class='button' data-filter='.".$term->slug."'>" . $term->name . "</a>\n";
			}
		}
	?>
</ul>

<?php $the_query = new WP_Query( array(
     'posts_per_page'	=> -1,
     'cat'			    => get_field('isotope_cat')
));
?>
<?php if ( $the_query->have_posts() ) : ?>

        <div id="isotope-list" style="margin-left:20px">

            <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>

            <div class="item col_6 last sub">
	        <?php if ( has_post_thumbnail() ) { ?>
        <a href="<?php the_permalink(); ?>">
                     <?php the_post_thumbnail(); ?>
        </a>
         <?php } ?>

        <div class="sub-content">
            <h3><?php the_category(', '); ?></h3>
        <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
            <?php echo get_excerpt(50); ?>
        </div>
	</div><!-- end item -->
    <?php endwhile;  ?>
    </div>

    <!-- end isotope-list -->
<?php endif; ?>

Thank you

suparna chowdhury on "WP_Query reset confusion"

$
0
0

Hi, I am new to WordPress. Right now I am hand coding a WordPress theme. While writing a custom loop I came across this statement
$wp_query = null; $wp_query = $temp
Now I am confused if this is equivalent as
wp_reset_quer
meaning do they both do the same job? I searched google and forums but could not find an answer.
Thanks in advance to anyone willing to help resolve this dilemma.

OddsNEnds on "Registration Override"

$
0
0

I recently got installed the Custom Registration Form Plugin.

Somehow I need to have this plug in overwrite the current Account Sign Up information/form WooCommerce provided me for Auctions. As it stands, I have people redirected towards my sign up form but it still allows people to access/view/sign up with the other one.

Any help would be greatly appreciated.

Benie76 on "Idea of having latest posts of blogs to show up as links on home page"

$
0
0

Let me explain what I mean. I own the website 'benies-blogs.com', and I heard that you can create a static webpage as your website's homepage.
Since I have two blogs hosted, I doubt it would be possible (plus I know nothing about php. I only know basic HTML).

So I'm wondering if there was some kind of 3rd party WordPress thingy that I can place on my HTML-based webpage, to automatically display my latest post for both my blogs (and provide links to them).

Is there such a thing? Google doesn't really seem to know what I'm asking for. It thinks I'm trying to find plugins for my Wordpress blog(s), and what I wanna do is the other way around.

cmdshorty on "Membership Site"

$
0
0

I've been doing research for 4 days now and haven't really found what I'm looking for. And I apologize if this thread is better suited somewhere else.

Here's what I'm looking to do: Create a membership site that once a user has registered and paid for said service level, a page is auto generated OR auto generate content to one page with specific content that only they can access. That content would only be available to that user ONLY.

I'll explain the flow in case I missed any details: User registers and pays on the site. When they access their membership account page, there's a link to a page (or content) that is tailored to them. On this page, they fill out a short form and hit submit. This user, I'll call them User 1, is only able to log in and view User 1 content. User 2 is able to log in on the same page but only see User 2 content.

I've got Paid Memberships Pro and look at numerous "content specific" plugins but they all seem to not do what I'm looking to do.

I've created a log in page and have content shown once logged in, but it's showing the content to ALL logged in users, not specific to the account. I've also created a new role with the proper capabilities as well.

From my understanding, a global Role would not work in this case. I've narrowed it down to using shortcodes to display content based on who is logged in but that is a little time consuming.

I would prefer to add the code myself so that I can better understand PHP coding, how it works, and how WordPress does things, but wouldn't mind using reputable and easy plugins to automate the process. Can always improve and upgrade later.

What you got for me?

Guido on "Select navigation > is my code still valid?"

$
0
0

Hi,

I have a menu with class 'nav-head' and use this to create a select menu bar for mobile screens. Using this code for several years now.

I don't know much about jquery so I'm wondering if this code is still valid or already contains deprecated parts?

jQuery(document).ready(function() {
	// build <select> dropdown
	jQuery("<select />").appendTo("div.nav-head");

	// create option "Menu..."
	jQuery("<option />", {
		"selected": "selected",
		"value": "",
		"text": "Menu..."
	}).appendTo(".nav-head select");

	// populate
	jQuery(".nav-head ul li a").each(function() {
		var el = jQuery(this);

		if(el.parents('.nav-head ul ul').length) {
			// if there are ul in li
			jQuery('<option />', {
				'value': el.attr('href'),
				'text':  '- ' + el.text()
			}).appendTo('.nav-head select');
		} else {
			// if no ul in li
			jQuery('<option />', {
				'value': el.attr('href'),
				'text': el.text()
			}).appendTo('.nav-head select');
		}
	});

	// make links work
	jQuery(".nav-head select").change(function() {
		window.location = jQuery(this).find("option:selected").val();
	});
});

Thanks in advance.

Guido


devler on "Youtube Audio Auto Playlist Plugin"

$
0
0

I have a site on which I want to create something like radio.

I have a list of 400+ Youtube links (songs) I'd like to include in my webradio. Thing is, I don't know if there's any plugin which would allow me to do that.

Functions I need:

Grab audio from the Youtube link, I don't want video on the site
Put multiple youtube links or multiple playlists in the plugin
Autoplay when I visit the site
Shuffle songs when I visit the site, I don't want to hear 400 songs all from beginning every time.
Show interpret + name of the song (I can input that manually or it could grab it from youtube)

Is there any plugin which would allow me to do this?

Zachary Nespral on "Replace TinyMCE with Custom Built Editor"

$
0
0

Hi,

I am looking to build a custom wiziwig, and replace wordpress's TinyMCE all together. Now I figured out how to add to the TinyMCE editor, but thats not what im looking for. Does anyone have any references for a starting point? Googling it only came up with the option to add to TinyMCE, not replace it with something custom all together. I'm new to theme development, so something detailed would be great. I really just need a starting point, then I should be able to get it from there.

Let me know if you have any questions

Thanks in advance,
Zac

HaukeNI on "Removing title link of custom post type"

$
0
0

Hi,

First off, I'm fairly new to WordPress development. I know my way around the GUI part pretty well but I'm not yet well versed on the php end. So if you reply, please be specific. Most importantly, please tell me what file the code should go into and where it's located. In the vast majority of answers I've found here I just see chunks of code pasted and I usually have no clue where it's supposed to go.

So here's what I would like to accomplish: I have created a custom post type "Dealer" that is being displayed as a list of search results. By default, each "Dealer" title is a link directing to the single post page. I do not want the titles to be links, since the single pages are irrelevant and shouldn't be accessed. I did find threads in the forum describing how to remove the anchor tags from all posts globally but I have not found any describing how to do it just for a specific custom post type but if one exists, feel free to just link me to that.

mikevisions on "echo some text only if a custom taxonomy has posts"

$
0
0

What I am trying to do is output some text only if a custom taxonomy has some posts.
I have found this code for a standard category;
<?php if (get_category('27')->category_count > 0)
echo "print something"; ?>

Which works for categories.
So I am trying to modify this for taxonomy use like this;

if (get_taxonomy('business_category')->taxonomy_count > 0)
echo "print something; ?>

I am now stuck in working out how to query a specific term in the taxonomy preferably bu 'slug'

Any help would be much appreciated.

ladee900 on "Syntax error"

$
0
0

I tried to edit the footer and I am getting this message below

Parse error: syntax error, unexpected 'k' (T_STRING) in /home/crestfbw/public_html/wp-content/themes/spacious/inc/functions.php on line 451

How can I undo or correct this I can not get back into my account

Alphard on "Pre-filling custom fields on New Post"

$
0
0

Hello,

I'd like to have a number of custom fields automatically pre-filled when a user opens the Add New Post page in the admin panel to create a new post. I've looked through the hooks but I can't find which one would be suitable. I'm also not sure how to go about pre-populating the custom fields section in the new post form. Any ideas?

bncpeter on "Prevent   characters from getting removed by the visual editor"

$
0
0

I'm a graphic designer and want my   (non-breaking space) characters to stay where I bloody-well put them without the visual editor stripping them out again. If you're a typography dick like me, this is handy to make two or more specific words wrap together rather than breaking at the spaces.

For example, if you want "South Australia" not to break in an address.

So, I wrote added a simple shortcode via my child-theme's functions.php:

//[nbsp] shortcode
function nbsp_shortcode( $atts, $content = null ) {
	$content = '&nbsp';
	return $content;
}

add_shortcode( 'nbsp', 'nbsp_shortcode' );

Then I just use:
[nbsp]
Instead of:
&nbsp;

Hope this helps someone.

Pt.


cogdog on "get_terms Multiple order_by options"

$
0
0

The 'orderby' => 'count' option for get_terms and get_tags functions saved me a bunch of custom coding to create a listing all terms in a custom taxonomy (I am using it to add terms for submitters twitter names, and using it as a leaderboard).

However, I would like to secondary sort terms with the same count by term_name. It would be nice to be able to provide an argument like

'orderby' => 'count,name'

to be able to have a secondary sort option.

Erfo on "Add author dropdown to quick draft (dashboard)"

$
0
0

I need add the author dropdown in quick draft of the dashboard.
How can I do?

angelmoskera on "Allow duplicate slugs for posts on Custom post type in different categories/taxo"

$
0
0

i'm making a photo gallery for a plastic surgery website, with before and after photos of patients. i made a custom post type /photo-gallery and a taxonomy /procedures, after reading this post i was able to include the taxonomy in the permalink, now i want to be able to generate permalinks like

www.site.com/photo-gallery/facelift/patient-1
www.site.com/photo-gallery/liposuction/patient-1
www.site.com/photo-gallery/breast-augmentation/patient-1

But instead i got a permalink like.

www.site.com/photo-gallery/facelift/patient-1
www.site.com/photo-gallery/liposuction/patient-1-2
www.site.com/photo-gallery/breast-augmentation/patient-1-3

is there a way to achieve permalinks like in the first group?

colabsadmin on "Filtering wp_get_attachment_image_src"

$
0
0

Can someone provide a working example of the new filtering capabilities that's been added to the wp_get_attachment_image_src function in 4.3? I'm trying to change the image source.

taxfreequid on "Is this Genuine Request From Word Press?"

$
0
0

Hello

I am unable to visits some of my wp websites,namely

www.soloadsmasters.org
www.buywebsitetraffic.club

Every time i try to visit the website, i receive a request to comeplete this

http://soloadsmasters.org/wp-admin/setup-config.php

If click on CONTINUE button, it takes me to this page

http://soloadsmasters.org/wp-admin/setup-config.php?step=0

I feel i've been hacked.

Does any one know if this is from wordpress and should I be concerned?

Please help me as almost all my websites are inaccessible due this

It's annoying.

Thanks.
Ken

Viewing all 8245 articles
Browse latest View live




Latest Images