0
votes
1answer
55 views

Wordpress - thumbnail image from youtube (function and loop)

Hi :D i need show thumbnails from youtube in homepage, i have a code for wordpress in function and the loop but not working thumbnail from youtube. What can be wrong with the code? Function Code: ...
0
votes
0answers
35 views

Filter Wordpress post Dynamically on dropdown selection?

Want to filter Wordpress post Dynamically on dropdown selection? But am not able to find out any solution how it can be done.Any help appreciated. Thanks On Clicking On Latest to Old the post ...
0
votes
1answer
70 views

Optimize CPT-function with a loop

I want to optimize my functions of a Custom Post Type (CPT). Now I have 10 meta boxes. For each box I have an extra function. The aim is to produce the 10 boxes in one function. I already tried the ...
-1
votes
1answer
196 views

How to Display Post View Count

I am trying to display post view counts. I've tried below function to display the post view count, but I'm getting same post view for all the post in loop. Not getting correct post view count. ...
-3
votes
2answers
45 views

What function does the loop of displaying posts?

What is the function that does the echoing of posts like post title in h1 and then the post body and then the author name. I hope everyone understood what I'm trying to say else please ask in comments ...
0
votes
0answers
44 views

Remove entry content from homepage index with infinite scroll

I have a WP theme (built on top of Genesis) and I'm having a problem with posts that are loaded on the homepage index with infinite scroll. Essentially, I'm only showing the article title, date, ...
0
votes
1answer
47 views

relation OR instead of AND - Filtered term ID's in loop

Question not related anymore.. First I tought about the relation OR/ AND for results, but I believe I should work with 'operator' => 'NOT IN'. I would like to query the results that meet multiple ...
0
votes
1answer
32 views

Breaking up multiple words and inserting an image after first word

I'm not sure if it's possible, however, what I'm after is to break up WordPress titles that are multiple words and then insert an image. My current loop works just fine. Right now it gets the page's ...
0
votes
2answers
275 views

Filtering posts by category name based on page's slug

I've created a page template and the goal is to create a loop that gets all posts by category name. The category name is passed from the slug of the page name. I haven't been able to get this to work ...
0
votes
3answers
628 views

How can I loop into two different DIVS without repeating the DIVs

I am having a little trouble trying to figure out how I can accomplish this: I have a container with two colums in it, a right and a left column. Each column will have 3 posts with a short excerpt ...
0
votes
1answer
22 views

Pagenav Not appearing on custom Template

I've just finished building a custom page template using the following code. The issue is the pagenav doesn't work - But works on every other page with multiple posts. I want this one to appear if ...
0
votes
0answers
31 views

the_content() function in loop-single.php

i need to show to different layout based on featured_image size for that how on can the_content() as per that. if featured_image .size =={ the layout would A } else{ the layout would B } how does on ...
-1
votes
1answer
203 views

Options.php loop won't show!

I'm creating an options panel for a theme on my localhost that's stored within the options.php file. My options panel will have two main loops. The first is to list the different sections and the ...
-1
votes
2answers
84 views

Why don't some template tags work when querying information on single.php?

I'm trying to fetch content about the current post into the header.php of my theme (to dynamically insert Facebook OpenGraph Metadata). Since I'm on a single post page, shouldn't it be able to run ...
0
votes
2answers
234 views

Strip <p> from <blockquote> or something better?

Looking for some help on something that has me really contemplating not using blockquotes for the moment! I have this code: <?php $show_after_p = 1; $content = apply_filters( 'the_content', ...
1
vote
2answers
50 views

2 Loops, Only Displaying 1 Loop in Both Loops

I have 2 loops, movie trailers and gaming trailers but gaming trailers is displaying under both Movie Trailers and Gaming Trailer. Each loop displays the post tagged with either Movie Trailer or ...
0
votes
2answers
107 views

Getting rid of the blog page entirely

My goal is to not use a separate blog page but end up with a structure like this... http://domain.tld/page/comments/ I believe I can do this with the Cornerstone plugin ~ [ ...
0
votes
1answer
212 views

The_excerpt() doesn't parse <!--more--> - how to change that?

I'm using the_excerpt(); in blog.php file (post listing page) and it doesn't recognize <!--more--> if "Excerpt" field is empty and it grabs the beginning of the content as excerpt. This issue ...
4
votes
2answers
739 views

Build a content and excerpt grid loop with paging and options for # of posts

What I'd like to do: on index.php, a loop that shows a selectable number of full posts using the_content and then below that shows a selectable number (the number of posts can be hardcoded in the ...
1
vote
2answers
191 views

Having a Function Inside of the Loop

I am trying to make a frontend product editor for WooCommerce, and have a loop that returns all of the products for the current user. I am trying to use gravity forms as the editor, so a single ...
1
vote
1answer
180 views

Function to show only first instance of shortcode

I need to add a function to my theme to remove additional instances of a shortcode in a post. First off I wonder if i'm approaching this wrong, but I have a theme that is drastically reformats the ...
0
votes
2answers
69 views

Way of getting queried loop before the query with a filter hook?

Is there a way to get the results of a loop with a filter before the code for the loop is performed in the structure of your code? My markup is something like this: <body> <div> /* ...
3
votes
2answers
1k views

How to display the_post_thumbnail if a post has one or otherwise display the first image in a post?

I would like to create a condition that checks to see if a post has a thumbail and if it does display it, otherwise display the first image in a post. I tried something like this in my loop.php but ...
0
votes
2answers
288 views

How to only publish posts with image in it

I use a standard loop in my index.php and that shows all the posts beeing posted. What i'm looking for is a code that only shows the posts that have image(s) in it. With other words: i only want to ...
1
vote
2answers
212 views

How to speed up a wordpress function with multiple loops?

I am a PHP novice and wrote this function. It is an alphabetical navigation which shows only the letter that have posts in both that letter and the currently filtered "genero" taxonomy term. I use ...
0
votes
2answers
782 views

Best way to style first post differently?

I am building a custom (child) theme and I want to style the first post of my loop in a different way than the others (bigger image, different position of some stuff). Which is the best way of doing ...
0
votes
1answer
81 views

Post variables not displaying correctly in custom function

There seems to be something wrong with the simple function below, but I can't figure out what it is. It is displaying as the following and I can't figure out why. I know it has something to do with ...
2
votes
2answers
2k views

Manually set global $post vars with an ID, in order to use template tags

I have a function retrieving ID's of posts by very specific means. I need to be able to set the global $post in order to use functions like the_content(), which does not allow an ID as a parameter. ...
0
votes
1answer
2k views

Simplest Way to Build Custom Archives Page?

I am looking to create a page in Wordpress to output links to all of our posts from every month since we launched the blog. I have seen the archive.php template file in Wordpress, but this seems to ...
1
vote
1answer
146 views

Help with Wordpress Query

I'm sort of a noob when it comes to Wordpess; I've only recently started building themes and I've run into a wall. I'm trying to feature 3 different articles at the top of my site using wpquery and ...
1
vote
1answer
659 views

Custom excerpt function re-factoring

This may be more of a php best practices question, but here goes... I am using a custom excerpt trim function: function new_wp_trim_excerpt($text) { // Fakes an excerpt if needed global $post; ...
0
votes
1answer
829 views

How do I pull excerpts from pages?

So I enabled custom excerpts on my pages with this function. add_action('init', 'page_excerpts'); function page_excerpts() { add_post_type_support( 'page', 'excerpt' ); } However, When I enter ...
1
vote
1answer
291 views

Show css depending on activity type in BuddyPress activity-loop

I was wondering if anyone knew of a way to show specific styles to the activity loop depending on the activity type? This is what I had an idea of: function mycustom_act_type() { if ...
0
votes
2answers
6k views

How would I create a shortcode to display a custom post within a page or regular post?

I would like to create a shortcode that will extract information for a custom post, and display it within a Page or regular Post. Specific use case: I have a custom post type "Film" for a film ...
0
votes
1answer
332 views

Output loop to function return?

I'm working on a shortcode function that returns a category image, a link to the category, the last three posts in that category, and another link to the category. See my code below: ...