Wordpress headway remove post permalinks - wordpress

I've been using the Headway theme to create a website. I used different posts to populate the site with content: using custom queries to single-out posts and display them in appropriate places in my layout.
https://204.140.22.120/
What I want to do is remove the permalinks from the post titles, because they're not supposed to lead to pages that display single posts.
But headway isn't using the standard .php file structure, so I can't remove "get_permalink" from each custom loop.
Is there a way to globally remove permalinks, or some other way to alter the many custom query loops in my site?
Thank you.

I think you would have to login via FTP and edit this file:
wp-content/themes/headway/library/blocks/core/content/content-display.php
From there look for this line (around line 363 - do a find on the word "bookmark" and you should find it)
$post_title_link = '' . $post_title . '';
and replace it with:
$post_title_link = $post_title;
Hope this helps ;)

Related

How to replace old external links with new ones in all Wordpress posts automatically?

How to replace old external links with new ones in all Wordpress posts automatically?
The links are in [embed] codes in the posts.
http://old-232.external.link.com/folder/etc.mp4
with
http://newexternallink.com/~newfolder/folder/etc.mp4
Note: the new external link is just an IP address.
Note2: the external links are in some of the posts.
If you take a backup of your database before trying, you may try a search and replace, for example by using a tool plugin like Better Search Replace
I guess there are several other options, but this is one of the plugins which gives you a preview on what is going to change, before doing the actual replacement.
If you add more specific details on what your replacing, you may get more spesific answers as well.
You can do this pretty easy with a simple plugin. Use the WordPress filter the_content
function my_content_filter($content){
//only add text before WordPress posts
if(is_single() && is_main_query()){
//reply all occurances of the old URL with the new URL
$content = str_replace([OLD_LINK], [NEW_LINK],$content);
}
return $content;
}
add_filter( 'the_content', 'my_content_filter' );
For more on this check out my post on how to Add Text Before And After Content In WordPress . Part 5 is about replacing content in all your posts or pages.

How to properly modify 2 lines of another plugins

I am coding some permalinks rewrite for WooCommerce awesome plugin.
Everything is well packed in a plugin and work well... except for one thing.
WooCommerce use get_term_link() to display HTML link in default template. A lot of custom templates use it too. If I want to display the good link on my website, I must change one line of code in woocommerce plugin. This is dirty, since basic user would not do it. Since I want to list it on Wordpress plugin repertory, I would like some help here...
What I need to do :
Open woocommerce.php and replace line 767 :
OLD
$product_category_slug = empty( $permalinks['category_base'] ) ? _x( 'product-category', 'slug', 'woocommerce' ) : $permalinks['category_base'];
NEW
$product_category_slug = '';
Very easy to do by editing the file, but it is dirty. It is non user friendly, and it depends a lot of woocommerce next version... So my question here: how can I do it from my own plugin, without asking people to open their woocommerce plugin with Notepad++... Is there any way ?
I hope you understand my need and could provide me with an answer :)
I already did same thing in Past.
Please Don't Modify WooCommerce Core files, Because it will be gone in your next upgrade.
Use this Custom Permlink Plugin, You will get Better Options there,

From which wordpress file i can change this page's layout

I am currently using wordpress for the website development and i want to change this page's formatting which is having url
http://www.selfmadesounds.com/dev3/?catid=featured&slg=featured3
I need to change this page's formatting such that i can exclude out the extra things from this page.
you are probably looking for category.php.
If you are a beginner with templating / themes / wp in general, you can simply search for class="category" and add a small string INSIDE the div in all of the template files where the search hit, one by one , and see which one is the one you look for .
You can insert <? php echo 'This is my page'; > or simply insert XXXXXX.
but just make sure you are not doing so in header.php, sidebar.php or footer.php - those will in all likelihood will appear on ALL your pages . ( also functions.php is to be excluded , but not in all cases ..)
but like others said, you should read the codex page about template hierarchy. it can also be any other filename (custom-loops.php file, custom-category-filename.php etc. depending on theme.
Edit I
I think you are mixing a bit of concepts here .
this line :
http://www.selfmadesounds.com/dev3/?catid=featured&slg=featured3
Is not a page, it is a URL with get parameters , and it represents a query for category : Featured with Slug : featured3 .
As for itself , it is NOT a page , it is a Query ( and i suspect that it is a plugin or theme related ). The query later produces , or renders a page .
At any rate , my advice still stands , Put a dummy code inside all the template pages and see which ones is your page .
For the rest - if you will supply more info or code , people could help more .
You have to check the Wordpress Template Hierarchy, a quick guess would be single.php from the active theme, but there is no way to be sure other than actually searching in the theme

Custom Plugin for wordpress with hierarchy of SEF pages

Here's my issue. My company needs a vendor database added to our wordpress website. None of the existing plugins will even come close to what we need, and we already have a mysql database with all of our information, so we need to create a plugin or something to do what we need.
These urls need to be direct-accessible and have SEF urls. So, for example:
mysite.com/vendors/
mysite.com/vendors/pipe-manufacturers/
mysite.com/vendor/bobs-pipes/
And, the custom content needs to appear inside the wordpress template.
There are really 2 options:
1) Find a way to write our application outside of wordpress, but find a way to bootstrap wordpress to show the header, footer, and sidebar.
2) Run the app from inside wordpress.
So I went for option #2. I created a new template file named "vendor.php", and began working. I added this code to my functions.php of my theme:
add_filter( 'template_include', 'xyz_template_check' );
function xyz_template_check() {
global $template;
$rqst = $_SERVER['REQUEST_URI'];
$ra = split("/", $rqst);
if ($ra[1] == "vendors") {
$template_file = get_stylesheet_directory() . '/vendors.php';
return $template_file;
}
return $template;
}
So what the above code does, if it sees the word "vendors" as the first part of the url after the site name, it sends you to vendor.php. This works PERFECTLY....
except...
Wordpress believes that the page is not found. It returns a 404 header, and NOT FOUND into the page title and breadcrumb.
Adding a PAGE called "Vendor Database" with the permalink "/vendors/" fixes the main page. But there will be literally hundreds of vendors and different categories. I cant be creating a custom page for each one. This needs to be dynamic.
So, how do I make wordpress give a 200, and supply an acceptable page title, breadcrumb, etc.
Don't even get me started on the danged wp_title filter. This did NOT work as documented. Although, it just occurred to me that this might be an issue with Wordpress SEO (the wp_title filter issue).
Anyone got an idea on this?
Ok got this. The solution was to use the rewrite api, as mentioned above, to look for the pattern /vendors/, letting it know that it was a valid URL. Coupled with my existing template override, this is what I needed.

Wordpress Plugin to Generate non-numeric slug / permalink for posts without titles? (1 post)

I've been looking for this all over, and simply cannot find it.
I have a blog that has no titles in its blog posts, but I'd like, for various usability reasons, to have the permalinks use the first few words from entries that do not have titles as the permalink slug.
ie, if the post on sample.com/blog is
Title: (no title)
Content: Ten Easy Ways to Lose Weight
The permalink could be sample.com/blog/ten-easy-ways-to-lose-weight.
Are there any plugins that do this? For the life of me, I cannot find one. (xposted to WP support, but no one is responding)
You could enter in titles, and then not display them in your view template.
I doubt there's anything like this already built for wordpress. To get your blog to do this, you have to write a plugin that does the following:
Generates the slug while checking
for uniqueness should you ever start
more than one entry with the same words
Processes URL requests to recognize slug permalinks and then updates the query step to locate the correct post in the database. This might involve a new db table of slugs (which would also help with the uniqueness issue)
In short, WP is designed to retrieve almost everything by keys, and to support slugs like this you'd have to create a new key type.
btw: if anything is retrieved by IDs (keys), it is technically not a permalink. so, wordpress probably fails in providing true permalinks.
ps: it's not that difficult to write an handler/dispatcher that would parse URL and takle out the unique permalink and then match it to the DB by the string (not by the key!).
something like:
$url=$_SERVER["REQUEST_URI"];
echo 'URL called: ',$url,'<br />';
$dispatchfile=$dispatcher->Dispatch($url);
if ($dispatchfile)
{
echo 'launching ',$dispatchfile,' inclusion<br />';
require($dispatchfile);
}
else
{
echo 'dispatcher failed to find module, will check physical file<br />';
if (file_exists($url)) echo 'dispatcher found physical file<br />';
else echo 'nada, throw 404!';
}
You can get a permalink redirect plugin from
http://scott.yang.id.au/code/permalink-redirect/
Works fine with WP2.71
It takes the Title and auto-creates a slug from that so you would have to manually enter the slug you wanted for each page if you have a Blank Title.
You should be able to hack Scott's PHP file (it is one page only) to look up the page code and select a portion of it to use as a slug though.
In addition, I solve incorrect page requests using a .htaccess rewrite file to bring up the index page upon an incorrect page request.
Download a copy of my rewrite file here
https://oulixes.com/htaccess_example.zip
Unzip the txt file and rename as .htaccess and upload into your root directory
Hope this helps!
Cheers,
Billy

Resources